Knowledge point 1, modify the color of the output
Echo-e "\e[1;31m This is red text \e[0m"
Where \e[1;31m indicates that the output is displayed in red, the \E[0M logo resets the color, and 31 can be replaced by a different color value, which is used to customize the text and background of the color.
Each color has a corresponding color code. For example: reset = 0, black = 30, red = 31, green = 32.
To set the color background, the frequently used color code is: reset = 0, black = 40, red = 41, green = 42, yellow = 43, blue = 44, magenta =45, cyan = 46, white =47
Knowledge point 2, viewing environment variables for a program
First step: pgrep node #获取某个程序的pid, node is replaced with the corresponding program name.
Step two: cat/proc/$pid/environ | Tr ' s ' \ n ' # $pid replaced with the corresponding process ID, and the pipe will replace the null character of the output with the line break
Knowledge point 3, Integer plus subtraction, in Ubuntu, the following method is feasible, other methods seem to be less feasible.
#!/bin/bashno1=4; NO2=5; result=$ ((no1+NO2))Echo $result
Save to be continued ....
Shell Learning Note 1