Hi,
I would like to use a shell variable
$amp
in my perl command line.
for fa in $WORKSPACE/*.fa; do
amp=`grep ">.*" $fa | sed -e's#>\(.*\)#\1#g'`
ampsam="$WORKSPACE/$base/$base.$amp.sam"
sqheader=`grep "^@SQ.*SN:$amp.*" $sam`
printf "$sqheader\n" >> $ampsam
#lines=`grep ".*\:.*\:.*$amp.*" $sam` # | sed 's/%/%%/'` #this also includes the @SQ line.
perl -n -e 'if($_=~/.*\:.*\:.*$amp/){print "$_";}' $sam >> $ampsam
done
Is there a way to do this?