So i need help on a simple assignment.
The assignment is:
** HW5 **
You have been hired to so some data processing. The directory "datafiles"
contains 1100 files of data that were captured by a SETI research
organization. Unfortunately some of the data files were mysteriously
damaged. You have been asked to write a shell script that will find the
damaged files.
All of the files are supposed to contain 16 lines of data. Some of the files
have fewer lines, some have more. Your script should go through all of the
files in the directory and print out just the ones that do not have exactly 16
lines in them.
For each defective file print only the file name. That is, after your script
runs you should see a listing of just the filenames of the defective files.
*NOTE: you need to use a for loop to do this. The following solution will not
be acceptable:
Neither will any other solution that doesn't use a loop to iterate over all ofCode:wc -l * | grep -v 16 | awk '{ print $2 }'
the files.
Also note that this is an easy way to loop over all of the files.
------
for f in `ls`
do
doneCode:echo $f
------
PS: This is for a UNIX basic's class. The teacher did not implement ANY C programing until these last two weeks. One of which i missed because i was snowed in.
So i am very confused any help would be greatly appreciated!



LinkBack URL
About LinkBacks



