The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #3 (permalink)  
Old 10-10-2008
gugs gugs is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 44
I still get the same result

I executed the following:

file="TEST01_*\.mqsc"
ls -1 $dir | grep $file > test.txt
rc=$?
echo "Return Code is: $rc"

The result was:

$ bash -x test.sh
+ delete_files='TEST01_*.mqsc'
+ file='TEST01_*\.mqsc'
+ ls -1 C:/cygwin/var/log/img/aut/
+ grep TEST01_080924.mqsc TEST01_080925.mqsc TEST01_080926.mqsc TEST01_080927.mq
sc TEST01_080928.mqsc TEST01_080929.mqsc TEST01_080930.mqsc TEST01_081001.mqsc T
EST01_081002.mqsc TEST01_081003.mqsc TEST01_081004.mqsc TEST01_081005.mqsc TEST0
1_081006.mqsc TEST01_081007.mqsc TEST01_081008.mqsc TEST01_081009.mqsc TEST01_08
1010.mqsc
+ rc=1
+ echo 'Return Code is: 1'
Return Code is: 1