Linux Shell Script Raiders 001

Source: Internet
Author: User

Shell scripts are usually text files that start with #!/bin/bash. #! is placed before the interpreter path.

Use bash as the interpreter to interpret all command-line commands.

There are two ways to run a script, one is to use the script as a command-line argument for SH, and the other is to use the script as an executable file with enforceable permissions. Run the script as a command-line argument as follows:

SH aa.sh: Assume that the script file is under the current path. Otherwise write full path execution. You can also execute scripts chmod a+x aa.sh./aa.sh by modifying the permissions of the script file.

Use # in the script to represent comments.

Terminal printing:

Echo is the basic command for terminal printing. echo "Hello" if there is a special character need to use the transfer character ' \ '.

printf can also be used for printing, as in C. printf "Hello"

Variables and Environment variables:

You can use the ENV command to view all environment variables associated with this terminal process at the terminal, which is used by the Export command to set environment variables.

Linux Shell Script Raiders 001

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.