0

I am trying to write a .bash script that takes 3 arguments and applies my sed script to the files found that where older than x days ago.

So for example my invocation is:

./program.bash <some_path> 2 -r

Inside my program I have

if [[$3 == -r]]; then
  find $1 -mtime $2 -exec sed -rf my.sed {}/;
fi  

However my -exec connection doesn't work. What am I doing wrong? is there any way to do this without using -f and putting the contents of my.sed directly on my bash program to be excuted?

User_x
  • 3

1 Answers1

0

Looks like you have error in escaping ; ...

try this... should just work fine

 find $1 -mtime $2 -exec sed -rf my.sed {} \;
Sandeep Kothari
  • 427
  • 2
  • 6