Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

What exactly is the sh command?

Writer Matthew Martinez

I can't figure out what the sh command is?

Does it execute a file?

like in tomcat:

sh /usr/local/tomcat/bin/shutdown.sh

Sorry, just confused.

2

2 Answers

sh is the bourne shell.

There are several shells, of which bourne is the old standard, installed on all unix systems, and generally the one you can guarantee will exist.

The shell is the command interpreter that takes your input, provides output back to the screen, to the correct files, etc, and provides all the basic built-in commands you need to manage jobs, kill, test expressions, etc.

Your command above is saying to run that shell-script using the bourne shell. Different shells use different syntax, so using the correct shell is a requirement. The first line of the shell should also define which to use: #!/bin/sh says use /bin/sh

1

sh is the bourne shell. /usr/local/tomcat/bin/shutdown.sh is a shell script. sh file runs file as a shell script. generally one would just set the execute bit and run ./file.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy