Skip to main content
added 8 characters in body; edited tags
Source Link
Gilles 'SO- stop being evil'
  • 866.5k
  • 205
  • 1.8k
  • 2.3k

I am trying to use find so it would finefind a script file and if found execute it in the same directory it found it in.

Something like this: find . -name "CLEAN" -execdir "CLEAN" {} ;

find . -name "CLEAN" -execdir "CLEAN" {} \; 

except {}{} is the file found file itself. Which, which is not what I want.

I am trying to use find so it would fine a script file and if found execute it in the same directory it found it in.

Something like this: find . -name "CLEAN" -execdir "CLEAN" {} ;

except {} is the file found itself. Which is not what I want.

I am trying to use find so it would find a script file and if found execute it in the same directory it found it in.

Something like this:

find . -name "CLEAN" -execdir "CLEAN" {} \; 

except {} is the found file itself, which is not what I want.

Source Link
SFbay007
  • 125
  • 1
  • 5

Find a file and execute a command in the file's directory

I am trying to use find so it would fine a script file and if found execute it in the same directory it found it in.

Something like this: find . -name "CLEAN" -execdir "CLEAN" {} ;

except {} is the file found itself. Which is not what I want.