I'm stuck on this script. I've defined a variable with a single cat of a temp file, and these are the following operations done by the script.
PROJECT=$(cat temp/project_name_final) ;
#Bifidobacterium contigs selection
grep "Bifidobacterium" ${PROJECT}_genera.txt | gawk '{print $2}' > temp/${PROJECT}_Bif_genera ;
gawk '{print $3}' ${PROJECT}_species.txt > temp/${PROJECT}_Bif_species ;
grep -v -f temp/${PROJECT}_Bif_species temp/${PROJECT}_Bif_genera > temp/${PROJECT}_selected_Bif ;
The first grep works fine, the awk one too. Variable is used well into the given filename. The last grep seems to work bad, and the generated file is named "_selected_Bif" , so the variable isn't used as before. I'm tryin to find a way to explain why I get this trouble.
TL;DR None of the used file are empty. The expected file, named "${PROJECT}_selected_Bif" also could not be empty, if grep works as expected.
bash -x
to see what commands are actually run. – muru Jun 12 '18 at 09:57echo PROJECT=\""$PROJECT"\"
before each command. – AlexP Jun 12 '18 at 10:01PROJECT
please could you humour me and add the output of runningecho ">$PROJECT<"
. – Chris Davies Jun 13 '18 at 15:02