Three ways How to Run sh scripts in Linux

Ads

linux_sh_products_designs_card-how-to-run-commands

Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh).

Bash is intended to be a conformant implementation of the IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).

How to run sh Script from Command line

First you must type the chmod command to change file access permissions to executable:
Use cd /home/user/script_dir to move to your script file.

chmod +x script.sh

Then you run one of the following commands:

./script.sh

or

bash script.sh

or

sh script.sh
Ads

Reply via Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>