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