如何将参数扩展与命令替换一起使用?

ter*_*ora 0 shell bash parameter command-substitution

    \n
  • 我想创建 12 个以月份命名的目录。因此,我尝试使用locale管道来获取月份名称,用逗号tr分隔它们,然后用大括号括起来并传递给mkdir. 但整体被视为一根弦。有办法避免这种情况吗?
  • \n
\n
16:07: temp \xe2\xa7\xb2 mkdir {$(locale mon | tr \\; ,)}\n\n16:18: temp \xe2\xa7\xb2 ls -lh\ntotal 4.0K\ndrwxr-xr-x. 2 john john 4.0K Dec 11 16:18 {January,February,March,April,May,June,July,August,September,October,November,December}\n\n16:18: temp \xe2\xa7\xb2 \n
Run Code Online (Sandbox Code Playgroud)\n

Str*_*tor 5

使用 ”;” 作为输入字段分隔符来分割输出locale man

IFS=';'
mkdir -- $(locale mon)
Run Code Online (Sandbox Code Playgroud)