Skip to main content
sh is not picked by default in all circumsances
Source Link
rools
  • 516
  • 3
  • 9

When you do not have any #! (called shebang) line, sh is used. To check thatwhich shell is used, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real shell is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash and zsh picks sh if no shebang is specified.

When you do not have any #! (called shebang) line, sh is used. To check that, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real shell is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash.

To check which shell is used, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real shell is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, sh command is implemented by bash and zsh picks sh if no shebang is specified.

When you do not have any #! (called shebang) line, sh is used. To check that, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real programshell is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash.

When you do not have any #! (called shebang) line, sh is used. To check that, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real program is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash.

When you do not have any #! (called shebang) line, sh is used. To check that, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real shell is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash.

Source Link
rools
  • 516
  • 3
  • 9

When you do not have any #! (called shebang) line, sh is used. To check that, you can run the following script.

ps -p $$ echo -n "The real shell is: " realpath /proc/$$/exe 

On my computer I get

 PID TTY TIME CMD 13718 pts/16 00:00:00 sh The real program is: /usr/bin/bash 

even if my default shell is zsh. It uses bash since on my machine, the sh command is implemented by bash.