Shell Programming Knowledge Collection _ Basic Tutorial

Source: Internet
Author: User
Tags case statement
In the afternoon, when writing a program, you need to assign the value returned by the shell command to a variable, using the a=$ () method
soft=$ (grep-i "\ Software \) token/passcode/." 123.txt |wc-l)
echo "[+] Soft card total:" $soft
......
The operation under the #!shell
over=$ ((Var-use))
echo "[+] remaining hard card:" $over


Shell's embedded command
: null, always return to True
. Performing actions from the current shell
Break exit for, while, until, or case statement
CD changes to current directory
Continue the next step to perform the loop
echo feedback information to standard output
Eval read parameter, execute result command
EXEC executes the command, but not in the current shell
Exit exits the current shell
Export exports the variable so that the current shell can take advantage of it
PWD Display current directory
Read reads one line of text from standard input
ReadOnly make variables read-only
Return exit function with returned value
Set controls the display of various parameters to the standard output
Shift command line argument left offset one
Test evaluation Condition Expression
Times displays the user and system time of the shell running process
Trap runs the specified command when the signal is captured
Ulimit Show or set shell resources
Umask Show or set default file creation mode
unset remove a variable or function from the shell's memory
Wait until the child process has finished running
PS: Finally make up a post about Shell programming
http://bbs.chinaunix.net/viewthread.php?tid=218853&extra=&page=1
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.