Bash command as variable -


i trying store start of sed command inside variable this:

sedcmd="sed -i '' " 

later execute command so:

   $sedcmd s/$orig_pkg/$package_name/g $f 

and doesn't work. running script bash -x, can see being expanded like:

   sed -i ''\'''\'''  

what correct way express this?

define shell function:

mysed () {     sed -i "" "$@" } 

and call this:

$ mysed s/$orig_pkg/$package_name/g $f 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -