shell - Looping through content of the current directory -


what best way inside directory , determine whether content directories or files. homework question.

my homework requires me write script counts number of directories, files, how many executable, writeable, , readable.

assuming you're talking bourne shell family, take @ -d, -x, -w... , i'm guessing -r tests. how loop works in bash see how iterate on files... general idea

for var in directory/*;     #stuff $var done 

but there particulars relating spaces in filenames can make trickier.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -