[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
weird interaction between builtin cat and trap
From: |
Peng Yu |
Subject: |
weird interaction between builtin cat and trap |
Date: |
Thu, 14 Apr 2022 09:31:15 -0500 |
Hi,
I got the following cat error when trap is set. If I remove the code
of trap, then there will be no such error. Is there a bug in builtin
cat?
$ cat main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
enable -f "$BASH_LOADABLES_PATH"/cat cat
trap 'echo EXIT' EXIT
seq 1000000 | builtin cat | {
seq 10 | {
while IFS= read -r ticker; do
curl -s https://httpbin.org/get > /dev/null
done
}
} {fd}<&0
$ ./main.sh
cat: write error: Broken pipe
EXIT
--
Regards,
Peng
- weird interaction between builtin cat and trap,
Peng Yu <=
- Re: weird interaction between builtin cat and trap, Peng Yu, 2022/04/14
- Re: weird interaction between builtin cat and trap, Jesse Hathaway, 2022/04/14
- Re: weird interaction between builtin cat and trap, Chet Ramey, 2022/04/14
- Re: weird interaction between builtin cat and trap, Jesse Hathaway, 2022/04/14
- Re: weird interaction between builtin cat and trap, Peng Yu, 2022/04/14
- Re: weird interaction between builtin cat and trap, Dennis Williamson, 2022/04/14
- Re: weird interaction between builtin cat and trap, Greg Wooledge, 2022/04/14
- Re: weird interaction between builtin cat and trap, Chet Ramey, 2022/04/15
- Re: weird interaction between builtin cat and trap, Peng Yu, 2022/04/15
- Re: weird interaction between builtin cat and trap, Chet Ramey, 2022/04/15