您的位置:首页 > 运维架构 > Shell

The distinct interpretation of the $(),${} between make and shell

2012-03-30 11:14 281 查看
1) In make $() = ${}

To substitute a variable's value, write a dolar sign followed by the name of the variable in parentheses or braces:

either '$(foo)' or '${foo}' is a valid reference to the variable foo

2) In shell: $() != ${}

2.1) The '$' character introduces parameter expansion,command substitution, or arithmetic expansion.The

parameter name or symbol to be expanded may be enclosed in braces,which are optional but servo to

protect the variable to be expanded from characters immediately following it which could be interpreted

as part of the name

2.2 ) Command substitution allows the output of a command to replace the command itself ,

Command substitution occurs when a command is enclosed as follows:

$(command)

or

`command`
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐