Originally Posted by postcd
colucix, no i think it should not.
sed /^\$domain$/d $domlist_bak > $domlist;rm -rf $domlist_bak
cp $domlistexp $domlistexp_bak
i think its correct and that is the place where the cp: error happening..? so error is in: cp $domlistexp $domlistexp_bak command?
He's saying your variable names are wrong, and the code you posted does not match the output you posted. Therefore you messed something up in copying things into your post, which, since the likely cause is a typo, makes it impossible to diagnose the problem.
rm -rf $domlistexp_bak
will NOT expand to
+ rm -rf domlist_bak
Which means you did not post your actual code or output, and we can do nothing to help you.
As colucix said,
indicates that your variables $domlistexp $domlistexp_bak being used in the cp command (or whatever you ARE using, since we've already established there's a discrepancy here) are not expanding, they're empty variables. This likely points to a typo in the code that you did not post here.