1. Get the return value of Command Execution
?
2. Get the return value of Script Execution
#!/bin/bashecho "A test."exit 0
Echo $ ?, Output: 0
3. Execute programs in the background in Linux
In Windows, use the start command and specify the/B Option (if there is log output, add a relocation, for example, 2> log). in Linux, add the & Symbol after the command.
4. What is the role of strip?
After strip is processed, the debugging information is removed, and the execution file size is much smaller. The command is as follows:
# Arm-Linux-strip FFMPEG
5. recursively count the number of directories and files. This function comes from the network.
readsub () { if [ -f $1 -o "$(ls $1)" = "" ]; then ((n++)) #recursion outdoor else ((n++)) for file in $(ls $1) do readsub $1/$file #begin recursion fi}
# When the file is used as an exit, the directory enters recursion as a parameter, and you can also use find
6. Retrieve the latest revision number from SVN
# Svn_dir is the svn URL 'svn info $ svn_dir | grep Revision: | awk '{print $2} ''' SVN up | grep revision | awk-f''' {print $3}' | awk-F '. ''{print $1 }''
# The two numbers obtained above are equivalent to the latest revision number displayed in the manual update operation, which is not the corresponding number of the latest code. Print 'svn info $ svn_dir' # You can see that, it may be the number after 'last changed rev.
7. Use sh-X to debug the script.
8. In the shell script, ECHO Displays the content with color, and ECHO Displays the content with color. You need to use the-e parameter.
9.
Terminate a process in Windows
Tskill PID
Task Manager ends manually
Ntsd-C q-p pid [Windows built-in tools, help for details]
The results of these processes are not very similar, and they do not understand the principles ..