You also can restore the blanks into underscores with:
In
vi as well in
sed and
perl, you can avoid the 'leaning toothpick syndrome' by choosing another delimiter e.g.
Code:
s!^\([^-]*\)-\(pkg.*\)!mv \1-\2 \1_\2!
or
Code:
s#^\([^-]*\)-\(pkg.*\)#mv \1-\2 \1_\2#