behaviour of echo with ? (the question mark) in gnome-terminal
I have the following script which isolates a problem I have been having:
#!/bin/bash
ps -C sleep -f|tr -s ''|grep sleep|head -n1
ps -C sleep -f|tr -s ''|grep sleep|head -n1|while read rec
do
echo $rec
done
exit
The results differ depending on the gnome-terminal window in which they are started.
Window 1:
$ /tmp/pstest
chris 15214 7874 0 06:43 ? 00:00:00 sleep 3934
chris 15214 7874 0 06:43 ? 00:00:00 sleep 3934
$ echo 06:43 ?
06:43 ?
Window 2:
$ /tmp/pstest
chris 15214 7874 0 06:43 ? 00:00:00 sleep 3934
chris 15214 7874 0 06:43 h m 00:00:00 sleep 3934
$ echo 06:43 ?
06:43 h m
As you can see, it seems to all come down to echo - which somehow decides that in some instances the ? means I need to be told something (that 06 is hours and 43 is minutes) I certainly do not. I am guessing it is some idiotic gnome option that presumes the computer is smarter than I am, since the behaviour differs from window to window (I believe at the moment that new windows give the second wrong result, windows started w/X as part of the session seem to give the first), but certainly shopts are the same in the bash shell.
Just upgraded to fedora core 1 from RH 9.0 with most available updates applied. I have bash-2.05b-34 (GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)). gnome is 2.4 (gnome-terminal-2.4.0.1-1).
|