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 -->
  #6 (permalink)  
Old 04-22-2009
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by Calypso View Post
Code:
for file in `find $dir -name "*.txt"`; do
The only problem is that some files have spaces in their names for example "/etc/space inFilename"

and then it prints the file out twice ie

/etc/space
inFilename

is there anyway to print it out as one?

Code:
find $dir -name "*.txt" |
  while IFS= read -r file; do