批量touch文件

使用for循環在/magedu目錄下通過隨機小寫10個字母加固定字符串mage批量創建10個文件

#!/bin/bash
b=''
a=(a b c d e f g)
for ((m=1;m<=10;m++));do
    for ((i=1;i<=10;i++));do
        c=$c${a[ $RANDOM % ${#a[@]} ]}
    done
    touch /magedu/$c_mage.txt
    c=''
done
#function a(){
#}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章