Shell writes a shell script for the variable when the command is executed [multiple commands are executed at the same time]. The script needs to run the variable as a shell command. There are many common methods, such: '$ {var}' executes the variable content as a shell command line $ ($ {var }) when the shell command executes $ {var}, the variable content is used as the shell command to execute [this method is not recommended]. However, only one command can be run in these three methods, if the command is of the following type, there will be a problem: VAR1 = 'CD/home; echo "hello "; echo "good" 'var2 = 'CD/home & echo "hello" & echo "good" 'at this time, $ ($ {VAR1}) will find no output, by tracking the command execution process, it is found that the shell will automatically run; & use ''for restrictions. To solve this problem, I found a lot of information and there is no good solution, this method is usually used in the crontab command, and the execution is normal. You can view the crontab Resource Finally, the awk system function is used to solve the problem. Solution: VAR1 = 'CD/home; echo "hello "; echo "good" 'var2 = 'CD/home & echo "hello" & echo "good" 'echo $ {VAR1} | awk' {run = $0; system (run)} 'echo $ {VAR2} | awk '{run = $0; system (run)}' the execution result is correct hello good