Three methods for executing shell scripts

Source: Internet
Author: User
There are basically three ways to execute shell scripts:
(1) input is directed to the shell script.
The general form is Bash <Script Name
For example, bash <test. Sh
(2) Use the script name as the parameter. The general form is:
Bash Script Name [parameter]
For example, bash test. Sh
If you execute a shell script using the current shell, you can use the following simple form:

. Script Name [parameter]

For example,. Test. Sh

(3) set the shell script permission to executable, and then execute it directly at the prompt.
Run the CHMOD command to modify the attributes of the file and then run
For example,
Chmod A + X test. Sh
./Test. Sh

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.