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

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,365
Quote:
Originally Posted by Hangman2 View Post
That worked.

I had to delete the file so I added

&& `rm $f`

Why are you trying to execute the output of `rm $f`?

It should be:


Code:
&& rm "$f"

If you just want to delete the files in dir4, why not:


Code:
rm  /dir1/dir2/dir3/dir4/* 2>/dev/null