当前位置: 技术问答>linux和unix
bash 不能使用括号,求助
来源: 互联网 发布时间:2017-02-26
本文导语: 我的LFS7.0 中bash不能使用括号, dd=$(uname -m) tt=$(dir) mm=$(cat filename) 只要有括号,一定报错 root:/tools# $(dir) bash: command substitution: line 6: syntax error near unexpected token `)' bash: command substitution: line 6: `dir)' root:/too...
我的LFS7.0 中bash不能使用括号,
dd=$(uname -m)
tt=$(dir)
mm=$(cat filename)
只要有括号,一定报错
root:/tools# $(dir)
bash: command substitution: line 6: syntax error near unexpected token `)'
bash: command substitution: line 6: `dir)'
root:/tools# $(uname -m)
bash: command substitution: line 7: syntax error near unexpected token `)'
bash: command substitution: line 7: `uname -m)'
求详解
dd=$(uname -m)
tt=$(dir)
mm=$(cat filename)
只要有括号,一定报错
root:/tools# $(dir)
bash: command substitution: line 6: syntax error near unexpected token `)'
bash: command substitution: line 6: `dir)'
root:/tools# $(uname -m)
bash: command substitution: line 7: syntax error near unexpected token `)'
bash: command substitution: line 7: `uname -m)'
求详解
|
我觉得ls们都没明白lz想干什么
lz的意思是说$(ls)或者$(uname -m)应该和`ls`一样,bash版本多少?
lz的意思是说$(ls)或者$(uname -m)应该和`ls`一样,bash版本多少?
|
dd=`uname -m`
|
dd是一个有功能的命令,你别给乱赋值,怪不得我看不懂……