I recently took a MacBook. I am trying to do some shell programs on my mac. I changed the shell to bash in my mac. When I started executing the shell scripts, I found echo -n
is not working as expected. Please help me if I missed any particular settings or so...
In the terminal window (it is working fine):
$ echo "Hello.."
Hello..
$ echo -n "Hello.."
Hello..$
In test.sh file:
#!/bin/bash
echo -n "Hello.."
Output:
$ sh test.sh
-n Hello..