When I run the bash script on ubuntu 9.10, I get a different behavior from the bash echo "-e" option, depending on whether I am running as root.
Consider this script:
$ cat echo-test
if [ "`whoami`" = "root" ]; then
echo "Running as root"
fi
echo Testing /bin/echo -e
/bin/echo -e "foo\nbar"
echo Testing bash echo -e
echo -e "foo\nbar"
When starting as a non-root user, I see this output:
$ ./echo-test
Testing /bin/echo -e
foo
bar
Testing bash echo -e
foo
bar
When I start as root, I see this output:
$ sudo ./echo-test
Running as root
Testing /bin/echo -e
foo
bar
Testing bash echo -e
-e foo
bar
Note that in the latter case, “-e” is reflected in “case-foo” instead of “foo” in the second line). When running the script as root, the echo command works as if "-e" had been specified, and if -e was given, the parameter itself would be an echo.
/bin/echo bash echo, , bash echo , .
- , ? bash ?
FYI - GNU bash, 4.0.33 (1) -release (x86_64-pc-linux-gnu)