Shell Scripting:目录中的文件夹数组并显示每个文件夹中的文件,重命名/删除选项
Here is simple example using array of folders. You can add additional logic which you need.
#!/bin/bash
FOLDER=(`ls -d /home/*/`)
number=`ls -d /home/*/ | wc -l`
a=0
while [ $a -ne $number ]
do
echo ${FOLDER[a]}
a=$(expr $a + 1)
done
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.