UNIX people needed!

Mashed Potato

Senior member
Feb 3, 2005
213
0
0
This is a question I have to answer. I have looked but I cant figure out how to awk a dir. Please help. If you don't want to answer it for me, could you direct me to where I could find the answer? Thank you....here it is:

cd to the /midterm directory. Using awk, generate an output that contains the file entry names and file type/permissions only of the file entries within the directory.

Separate the file entry names and file type/permissions columns by a colon :)).

The output should resemble the following:

filename : permissions

A) What awk command string did you use?

>awk '{print filename: permission}' midterm *filename: permission being the entry I do not know.

Midterm is a dir, could I ls -l saving the output to a file and then go from there? If so, what is the command to save the output to file. Can it be done with one string?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What they probably want you to do is pipe the output from ls -l and redirect the output from awk to a file. And if you google 'awk variables' you should be able to figure out what to replace "filename: permission" with.