Top "Sh" questions

sh is the standard Unix shell since Version 7 Unix.

Run bash script with sh

I have bash script and it requires bash. Another person try to run it with sh script_name.sh And …

linux bash shell sh dash-shell
How can I test if line is empty in shell script?

I have a shell script like this: cat file | while read line do # run some commands using $line done Now …

bash shell sh
How to show wget progress bar only?

For example: wget http://somesite.com/TheFile.jpeg downloading: TheFile.tar.gz ... --09:30:42-- http://somesite.com/TheFile.jpeg => `/…

linux bash wget sh
Running two commands sequentially in a cron job?

I have two commands in a cron job like this: mysql -xxxxxx -pyyyyyyyyyyv -hlocalhost -e "call MyFunction1";wget -N http://…

cron sh
How to add a new line in the bash string?

The new line \n is not taken account in the shell strings root@toto:~# str="aaa\nbbbb" root@toto:~# echo $…

linux bash shell sh ash
shopt command not found in .bashrc after shell updation

I have updated my shell to ZSH . When i source ~/.bashrc . I am getting this error There was some error …

bash sh zshrc shopt
Today's date, minus X days in shell script

I need to create three variables, each for Year, Month, and Day for Today's date, minus X number of days. …

bash sh
What is the benefit of using $() instead of backticks in shell scripts?

There are two ways to capture the output of command line in bash: Legacy Bourne shell backticks ``: var=`command` $() syntax (…

bash syntax sh backticks
Why does my bash code fail when I run it with sh?

I have a line of code that works fine in my terminal: for i in *.mp4; do echo ffmpeg -i "$…

bash sh substitution
Terminal error: zsh: permission denied: ./startup.sh

I am running a command ./startup.sh nginx:start and I am getting this error message zsh: permission denied: ./startup.…

macos nginx terminal sh