I've got the following problem regarding to sed command. What I wish to do is:sed '1 d' filename.fa | sed 1i\>filename\n > filename_Edited.fawhere the file frist line is replaced by >filename. This is done in 2 steps: deleting first line and then inserting a new one which contains the desired >text. The command works as it is wirtten above if it is typed directly into the console (w/o  variables). However, I need this command integrated in the following script where filename is now depending on a variable:#!/bin/bashCODE=`cut -c 7-21 Data.txt`cd ../FASTA_SEC/ for i in ${CODE} do sed '1 d' ${CODE}.fa | sed 1i\>${CODE}\n > ${CODE}_Edited.fa doneI get the following error when this script is ran for each for loop iteration:try: line 8: ${CODE}_Edited.fa: ambiguous redirectI dont get whats wrong in sed sintaxis orin the overall script, Aparently it should work but it does not. Any clue?I have also tried to run the script without pipped part, only executing the sed which deletes first line from the text:#!/bin/bashCODE=`cut -c 7-21 Data.txt`cd ../FASTA_SEC/ for i in ${CODE} do sed '1 d' ${CODE}.fa > ${CODE}_Edited.fa doneHowever, it returns the former error again!Thank you for yr help!!**.fa format are known as fasta which are a kind of plain text format used in DNA sequences
sed in bash scripting troubleshooting
bash;sed;scripting;variable