Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with ls -l script

Status
Not open for further replies.

davemib

Programmer
Dec 31, 2002
30
0
0
GB
i have a file called C which has the following information:

{n++;t+=$4};END{print "total number of files "n " " "total size"t
print $5, $9}

the code to run on command line is :

Ls –l | grep –v ^d | awk -f C

my problem is that it only prints one ordinary file out of the list. i have 19 oridinary files and only the last file is being printed. how can i make it print out the entire list cuz @ the moment the code which prints from the list is "print $5, $9"

can ne1 help me with this small problem
 
Maybe

{print $5, $9; n++; t+=$5}
END{print "total number of files " n " total size "t}

CaKiwi
 
thanx CaKiwi it worked

thank you very much!!!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top