簡體   English   中英

在 Shell Scripting Array of folders in directory 和顯示每個文件夾中的文件,重命名/刪除選項

[英]In Shell Scripting Array of folders in directory and show files in each folder, rename/delete option

Shell Scripting:目錄中的文件夾數組並顯示每個文件夾中的文件,重命名/刪除選項

這是使用文件夾數組的簡單示例。 您可以添加所需的其他邏輯。

#!/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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM