I used this question to strip the newline from a string, but I've encountered a problem on one host.
For some reason, /bin/echo -n foo
prints nothing on that host. I have no idea why that host behaves oddly. /bin/echo foo
works fine. It's not the terminal, since echo -n foo > /tmp/bar
also shows nothing.
/bin/echo --help
says that is should work:
Usage: /bin/echo [OPTION]... [STRING]...
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version output version information and exit
% /bin/echo --version
echo (GNU coreutils) 5.97
What can possibly cause this not to work? Could there be some strange buffering in this bash-shell?