I have a file that contains a list partial names of files. From that list I need to do an ls command to find the complete name of the files and output it to another file.
For example : my file name_list contains
tom_smith
joe_doe
...
The above list is the beginning of the file names that I am looking for.
so I need to do an ls of each name , like this
ls tom_smith*.txt
ls joe_doe*.txt
I have this so far but it is not working...
---------------------------
#!/bin/csh -f
foreach i (`cat ./name_list`)
ls $i\*.txt >> datafile_name
echo $i
end
thanks,
olmos
For example : my file name_list contains
tom_smith
joe_doe
...
The above list is the beginning of the file names that I am looking for.
so I need to do an ls of each name , like this
ls tom_smith*.txt
ls joe_doe*.txt
I have this so far but it is not working...
---------------------------
#!/bin/csh -f
foreach i (`cat ./name_list`)
ls $i\*.txt >> datafile_name
echo $i
end
thanks,
olmos