【发布时间】:2022-01-09 15:14:18
【问题描述】:
到目前为止,我有这个,我在所选文件夹中创建了我想要的文件夹数量。创建的文件夹数量取决于我的选择。
如何在每个文件夹中创建文件?我希望它们根据我选择的文件数量从 1 开始编号。
read -p "Enter the number of folders to create: " FOLDER_X
read -p "Enter the number of files to create: " FILE_Y
for (( x = 1; x <= FOLDER_X; x++ )); do
mkdir $DIRY/$x
done
for i in {"$FILE_Y"}
do
echo hello > "$i.txt"
done
【问题讨论】: