I am trying to store the start of a sed command inside a variable like this:
sedcmd=\"sed -i \'\' \"
Later I then execute a command like so:
Not exactly sure what you're trying to do, but my suggestion is:
sedcmd="sed -i "
$sedcmd s/$orig_pkg/$package_name/g $f
You must set variables orig_pkg
package_name
and f
in your shell first.
If you're replacing variable names in a file, try:
$sedcmd s/\$orig_pkg/\$package_name/g $f
Still f
must be set to the file name you're working on.