I have a tiny question. When I execute my shell file by 'sh', it works differently. (it printed '-e')
Google says "Check your first line(#!/bin/bash) and 'env | grep sh'" But there no do difference in my eyes... Would you tell me why it is?
+++ I tried changing '#!/bin/bash' → '#!/bin/dash', but noting changed.
Thanks for reading..
[my first code(first.sh)] -bash
#!/bin/bash
echo -e "hi"
[run script and result]
# . first.sh
Hi
# source first.sh
Hi
# sh first.sh
-e hi
[my second code(second.sh)] -dash
#!/bin/dash
echo -e "hi"
[run script and result] nothing change...
[OS] ubuntu 18.04
[environment]
# env | grep sh
SHELL=/bin/bash
# ll /bin | grep sh
-rwxr-xr-x 1 root root 1113504 6월 6 2019 bash*
-rwxr-xr-x 1 root root 121432 1월 25 2018 dash*
lrwxrwxrwx 1 root root 4 6월 6 2019 rbash -> bash*
lrwxrwxrwx 1 root root 4 7월 18 2019 sh -> dash*
lrwxrwxrwx 1 root root 4 7월 18 2019 sh.distrib -> dash*