help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird interaction between builtin cat and trap


From: Peng Yu
Subject: Re: weird interaction between builtin cat and trap
Date: Thu, 14 Apr 2022 09:36:47 -0500

This code is the even simpler to reproduce the error.

$ 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 | {
        :
} {fd}<&0
$  ./main.sh
cat: write error: Broken pipe
EXIT

On 4/14/22, Peng Yu <pengyu.ut@gmail.com> wrote:
> 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?



-- 
Regards,
Peng



reply via email to

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