我想mkdir
为:
site1/www,site1/log
site2/www,site2/log
site3/www,site3/log
这些文件夹的权限为700
。
然后我在Bash shell中尝试了如下脚本:
sites_arr=(site1 site2 site3)
for sitename in ${sites_arr[@]}
do
mkdir $sitename
mkdir –m 700 –p /var/${sitename}/{www/,log/}
done
但是mkdir –m 700 –p ${sitename}/{www/,log/}
总是给我错误:
mkdir: cannot create directory ‘–m’: File exists
mkdir: cannot create directory ‘700’: File exists
mkdir: cannot create directory ‘–p’: File exists
问题出在哪里?