A collection of shell programming knowledge

Source: Internet
Author: User

Write in the afternoon ProgramYou must assign the value returned by the shell command to a variable and use the = $ () method.
Soft = $ (grep-I "\ (Software \) token/passcode/." 123.txt | WC-l)
Echo "[+] Total number of soft cards:" $ soft
......
#! Shell operations
Over = $ (Var-use ))
Echo "[+] remaining hard cards:" $ over

Shell embedded command
: NULL. True is always returned.
. Execute operations from the current Shell
Break exits for, while, until, or case statements
CD changed to the current directory
Continue
Echo feedback to standard output
Eval reads parameters and executes the result command
Exec executes the command, but not in the current Shell
Exit to exit the Current Shell
Export exports the variable so that the current shell can use it.
PWD displays the current directory
Read read a line of text from standard input
Readonly Read-Only variables
Return: exit the function with the returned value
Set controls the display of various parameters to the standard output.
Shift: shifts the value of the command line to the left.
Test Evaluation condition expression
Times displays the user and system time during Shell Running.
Trap: Specifies a command when a signal is captured.
Ulimit displays or sets shell Resources
Umask displays or sets the default file creation mode
Unset deletes variables or functions from shell memory
Wait waits until the sub-process is completed
PS: Add 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.