Is command substitution $(foo) bashism?

后端 未结 2 1204
小鲜肉
小鲜肉 2020-12-15 10:24

There are two different syntaxes for command substitution,

FOO=$(echo bar)

and

FOO=`echo bar`

As far as I

2条回答
  •  一个人的身影
    2020-12-15 11:00

    Actually, the $(...) command substitution syntax is defined by POSIX, though it's not part of the earlier SVID sh standard. So as long as you don't care about running on pre-POSIX systems, it should be fine.

提交回复
热议问题