I am running Ubuntu 14.04.3, it's uptodate. I don't know why, for a few days I began to take
grep: write error: Broken pipe message on launching gnome-terminal . It seems to be harmless but it bothers me. How can I debug it?
EDIT: I moved aliases and functions each to separate files such as
.bash_functions and added a command to load them from
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi if [ -f ~/.bash_functions ]; then . ~/.bash_functions fi
If I don't load
.bash_functions problem disappears.
I am trying to find the faulty one by disabling each function one by one.
This one gives me the same error but when I disable it I keep getting the same error, so I may have more faulty functions.
ls -lt $PWD| grep ^d | head -1 | cut -b 51- grep: development write error: Broken pipe
I wonder why I begin to take that error.
I found a similar problem here boken pipe
The root of the problem also seems similar.
I tried the given test command in the link which have the same error:
bash -c '(while echo foo; do :; done); echo status=$? >&2' | head foo foo foo foo foo foo foo foo foo foo bash: line 0: echo: write error: Broken pipe status=0
unbuffer workaround I posted below as an answer to my own question works, I am not satisfied with it, but my knowledge about debugging is limited. Acoording to this link https://lists.gnu.org/archive/html/bug-coreutils/2007-11/msg00080.html it stems from SIGPIPE trap by another task, and this link https://lists.gnu.org/archive/html/bug-coreutils/2007-11/msg00154.html pinpoints the exact cause of the problem, it's one of the pam authentication module which I am in trouble with it recently.