The following commands and question is merely aim to figure out proper syntax, so please don't seek for any deep purpose behind it, but rather if you know the proper syntax this would be of a huge help to me.
I have the following: *using here perl -e in order to mimic a perl file that calls to system() command in order to execute unix commands.
perl -e '$i="file.bed"; system("j=$i; echo ${i} ;echo \${j}; echo \${j%.*};")';
this command nicely outputs:
file.bed
file.bed
file
I'd like to add another echo that replaces the suffix ".bed" to the suffix ".bam" I tried:
perl -e '$i="file.bed"; system("j=$i; echo ${i} ;echo \${j}; echo \${j%.*}; echo \${j/.bed/.bam}")';
but i get:
file.bed
file.bed
file
sh: 1: Bad substitution
same goes for:
perl -e '$i="file.bed"; system("j=$i; echo ${i} ;echo \${j}; echo \${j%.*}; echo \${j\/.bed\/.bam}")';
So for some reason the suffix removal [%.*] works just fine within system(), but {//} substitution fails.
Any ideas?
systemdoesn't usetcsh, so that's a rather useless statement.