· CMD in the execution of the shell regardless of · What is the content of, advanced interpretation, and then the interpretation of the final results to the shell, if the result of interpretation is not the shell can command, will be error. However, only the execution results of CMD are output as text, there is no problem.
Such as:
[Email protected] root]# i=0
[Email protected] root]# name=pwd
[[Email protected] root]# ' $i ' # $i have obtained the result 0, and then give 0 to the shell execution, of course, error
-bash:0: Command not found
[[Email protected] root]# ' $name ' # $name has been equivalent to the implementation of the PWD, get/root, at this time/root to shell execution, of course, can not explain
-bash:/root:is a directory
[[email protected] root]# echo "' $name '" # to output the contents of $name after execution as text
/root
[[Email protected] root]# ' pwd '
-bash:/root:is a directory
(cmd) at execution, if CMD is a command, then directly to the shell to execute, if the variable value, then only the first layer of the literal interpretation of the shell is dropped
Such as:
[Email protected] root]# i=0
[Email protected] root]# name=pwd
[[Email protected] root]# ($i) # after explaining to get 0, and then give 0 to the shell, of course, error.
-bash:0: Command not found
[[Email protected] root]# ($name) # after explaining to get PWD, then send pwd to shell execution.
/root
[[Email protected] root]# (PWD) # Just throw the PWD to the shell to execute
/root
Shell Learning Note (2) Replace command • • The difference from ()