I want to rename *.DIF files to *.SUC files But the following script is giving "sh: bad substitution" error I cannot use "rename" becuase my OS is not Linux.
$com="for i in *.DIF; do mv \$i \${i/DIF/SUC}; done;";
print $com."\n";
print `$com`;
Output :
for i in *.DIF; do mv $i ${i/DIF/SUC}; done;
sh: bad substitution
renamefunction?SUC, but the output hasDIFFF?run with sh. But really. Don't do this. Cross contaminating scripting languages is an excellent way to build yourself some horrific bugs and unmaintainable code. Stick to one language - perl or shell, doesn't matter which.