【发布时间】:2016-06-26 23:10:19
【问题描述】:
我希望该脚本在我引入目录时执行 cicle,并要求我在那里的每个文件更改 perm 。为什么这个输出总是找不到“文件”?但文件存在
fucntion permi {
echo "What is the path of the file? the introduce the name of the file:"
read DIRECT
file=`ls -l ${dir} | cut -f 9 -d " "`
while read file
do
echo "[u|g|o]"
read who
echo "[r|w|x]"
read ans
chmod ${who}+${ans} $file
done
}
【问题讨论】:
-
能否请您举例说明输入和预期输出?
-
示例:我在 dir /tmp 中有一个文件 text1,他读取文件并显示 echo ugp,我写 ug,然后 r|w|x,我写 wx,然后使用 chmod我写的输入像 chmod ug+wx text1 @mebada
-
circle = 迭代或循环 .. 请在您的帖子中验证以更清楚