The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-10-2008
gugs gugs is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 44
I was incorrect

ls -1 C:/cygwin/var/log/img/aut/ | grep TEST01_*\.mqsc produced no output.

Anyway, instead of file="TEST01_*.mqsc", file="TEST01" should suffice as I am only interested in files that start with "TEST", * is for the date and .mqsc is consistent for all files.


However, I was making a silly error in the script. All I had to do was:

file="TEST01"
echo "File = $file"
ls -1 $dir | grep "$file" > test.txt

Thanks for helping me