Home  >  Article  >  Operation and Maintenance  >  linux $() $difference

linux $() $difference

藏色散人
藏色散人Original
2019-11-05 10:14:012705browse

linux $() $difference

##linux $() $Difference

$

$ The symbol appears in different places, and the definition it represents will be different. For example, in bash, the $ symbol indicates that the current user is a normal user; in bash scripts. $ starts with a variable.

For example, here are some special variables:

$ represents the number of parameters

$0 is the name of the script itself

$1 is passed to the shell script The first parameter

$2 is the second parameter passed to the shell script

$@ represents all parameters, and all parameters are independent

$ is running The current process ID number of the script

that$ shows the exit status of the final command, 0 means there is no error, and other means there is an error.

$()

$(): The command is placed in parentheses, which has the same effect as `` backticks. Execute this command

For example, the function of $(command) is to execute the command and output the result (of course, this output is not on the screen, but must be placed in a specific context).

Recommended: "

Linux Tutorial"

The above is the detailed content of linux $() $difference. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn