On Fri, 29 Apr 2005, Paul Jackson wrote: > > > bash is being an ass about SIGPIPE > > You have a multiprocessor, don't you. Yes. > The following silly little shell script will provoke the bash SIGPIPE > complaint reliably on a multiprocessor. Yup: t: line 5: 3853 Broken pipe cat /etc/termcap t: line 5: 3855 Broken pipe cat /etc/termcap > Adding a right trap _inside_ the shell loop that is _before_ the pipe > will reduce the verbosity of the complaint substantially (not show the > line number and text for each command inside the loop that is killed by > the SIGPIPE; rather just show the simple "Broken pipe" error message): > > Code Sample 2: > > #!/bin/bash > for x in 1 2 > do > trap continue PIPE # reduce broken pipe screeching > cat /etc/termcap # a big text file > done | sed 1q Didn't change anything for me. Same thing. > Then wrapping the entire pipeline (now that the bogus output is a > constant "Broken pipe" string) in the following manner will filter out > just that noise, leaving whatever else was on stdout and/or stderr > unscathed: It will also grep out any occurrence of "Broken pipe", so if we're talking about a kernel changelog, where we fix a pipe bug... > Whether or not this is actually worth persuing (or was even worth > reading ;) I don't know. I don't know why the bash people have that stupid pipe reporting in the first place, considering that no other shell seems to do it, and everybody just wants to shut it up.. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Sat Apr 30 12:58:30 2005
This archive was generated by hypermail 2.1.8 : 2005-04-30 12:58:30 EST