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
Post a Comment