Shell script learning for Linux systems

Source: Internet
Author: User
Linux system learning-shell script learning-Linux general technology-Linux programming and kernel information. The following is a detailed description. 1. (The use of colons)

: $ {Username = 'whoam'} # as a placeholder
:$ {HOSTNAME ?} $ {USER ?} $ {MAIL ?} # Set Evaluation Parameters
:> Data. xxx # file "data. xxx "is cleared now. This is the same as cat/dev/null> data. xxx works the same but does not generate new processes, because the colon is a built-in command.

2. ** is a power operation.

3. $? Exit status variable. $? Save the exit status of a command, function, or script.

$ Process ID variable. This $ variable saves the running script process ID

4. braces {xxx, yyy, zzz ...}

Braces extension, such:
Cat {file1, file2, file3}> combined_file
# Connect file1, file2, and file3 and redirect them to combined_file.
Cp file22. {txt, backup} # copy "file22.txt" to "file22.backup"

Echo {file1, file2 }\:{\ A, "B", 'C '}
# Output file1: A file1: B file1: C file2: A file2: B file2: C

Braces represent code blocks, but the variables can be seen outside. Variables in parentheses are irrelevant to the outside world.
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.