【发布时间】:2014-02-22 01:57:09
【问题描述】:
编写一个遵循以下算法的 shell 程序,以获得一个 名称以 3 个字符扩展名结尾的所有目录的长列表, 并且其权限是用户(所有者)的 rwx。
ALGORITHM:
1. Do the same ls command you used in question 2 above, except REDIRECT
the ls command's stdout to go into a file named tempFile (instead of
the monitor).
2. Use grep to filter the lines of tempFile so that a line is kept ONLY
if it corresponds to a DIRECTORY that has rwx permissions for its
user (owner).
3. delete (remove) tempFile
到目前为止,我卡在 1 i 上:
ls -ld *.??? > 临时文件
【问题讨论】:
-
为什么你所拥有的东西不起作用?
-
另外,FIE 关于提出第 2 步的人。
-
它有效,但我知道我必须为第 2 步做什么