我在我的设备上使用Busybox。当我尝试删除多目录时,我的花括号似乎被Busybox中包含的"rm“命令忽略了。有什么方法可以增加对它的支持吗?它破坏了一些包含带大括号的脚本的包,我不想在自己的脚本中放入循环。
示例:
rm -rf /some/path/{foo,bar}发布于 2019-08-12 16:02:01
这取决于您使用的shell。Busybox至少有两个默认shell:ash和hush,根据您构建它的方式,您可能会同时使用这两个shell。如果rm -rf /some/path/{foo,bar}对您不起作用,那么您可能正在使用ash。您可以查看:
$ echo $0
ash检查您是否有hush
$ busybox hush大括号应该可以在hush中使用
$ mkdir /tmp/curly-test
$ cd /tmp/curly-test
$ touch foo bar
$ cd /tmp
$ ls curly-test/{foo,bar}
curly-test/bar curly-test/foo另请注意,作为最后的手段,您可以简单地用bash替换/bin/sh。
https://stackoverflow.com/questions/57457097
复制相似问题