![](/img/trans.png)
[英]How can I split the String output of an ls command into an array on just the filenames in bash?
[英]How can I access the output of ls in bash?
我编写以下脚本,希望将文件打印在目录中。 但这只是在屏幕上显示字符串“ ls”。
问题是什么?
#!/bin/bash
for FILE in 'ls'
do
echo $FILE
done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.