编写shell程序stdout

编写shell程序stdout,shell,glob,ls,Shell,Glob,Ls,按照下面的算法编写一个shell程序,以获得 名称以3个字符扩展名结尾的所有目录的长列表, 并且其权限为用户(所有者)的rwx 到目前为止,我一直坚持1 i: ls-ld*?>tempFile这对我很有用: #! /bin/bash ls -ld * > tmp # get a list of the permissions of all directorys in this folder and write it to the tmp file grep "^drwx" tmp #

按照下面的算法编写一个shell程序,以获得 名称以3个字符扩展名结尾的所有目录的长列表, 并且其权限为用户(所有者)的rwx

到目前为止,我一直坚持1 i:

ls-ld*?>tempFile

这对我很有用:

#! /bin/bash

ls -ld * > tmp   # get a list of the permissions of all directorys in this folder and write it to the tmp file
grep "^drwx" tmp # filter the tmp files for lines beginning with drwx
rm tmp           # remove the file tmp

为什么你所做的不管用?还有,不管是谁提出了第二步。它管用,但我知道我必须为第二步做什么
#! /bin/bash

ls -ld * > tmp   # get a list of the permissions of all directorys in this folder and write it to the tmp file
grep "^drwx" tmp # filter the tmp files for lines beginning with drwx
rm tmp           # remove the file tmp