help-bash
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]