I want to convert the following command to a tcsh shell alias for reuse:
find uvm_template/ -type f -exec sed -i 's/CANDY/SE_IP/g' {} \;
I added to the alias file the following:
alias find_and_rep 'find $1 -type f -exec sed -i \'s/$2/$3/g\' {} \;'
where $1 is the folder path, $2 the word to find, and $3 the word to replace.
When I execute source ~/.aliases to the alias file, I got the following error:
Unmatched '.
I tries also the following alias:
alias find_and_rep 'find $1 -exec sed -i "s/$2/$3/g" {} \;'
But when I execute the alias from the terminal I got the following:
find_and_rep uvm_template/ CAND SE_IP
find: paths must precede expression: uvm_template/
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]