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 -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -