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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 12-04-2007
reborg's Avatar
reborg reborg is offline
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,829
I'm a bit rusty on csh, since I never use it but if I remember correctly from when we had a bunch of users to support who did use it, the syntax would be something like:

Code:
foreach file ( *_myfile )
    echo $file
end
or if you want the action a or action b

Code:
ls *_myfile >& /dev/null
if ( $status == 0 ) then
    foreach file ( *_myfile )
        echo $file
    end
else
    echo "no files"
endif
Reply With Quote