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 -->
  #2 (permalink)  
Old 10-13-2008
cfajohnson's Avatar
cfajohnson cfajohnson is online now Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,379
Quote:
Originally Posted by rkasowan View Post
Hello forums!
Here is a snippet:


Code:
for file in `ls "/test folder"/*.ext`; do echo "$file"; done

Not only is there no need for ls, but it's breaking your script.

Use the wildcards directly:


Code:
for file in "/test folder/"*.ext