From a47fe6ff199849385d34839d4b2d8cad91280361 Mon Sep 17 00:00:00 2001 From: JWesseling <161333482+JWesseling@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:55:27 +0200 Subject: [PATCH] Update makeblastdb.sh Changed line 14,15 and 16 to be POSIX compliant --- workflow/scripts/makeblastdb.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow/scripts/makeblastdb.sh b/workflow/scripts/makeblastdb.sh index 1dd5354..4a69645 100644 --- a/workflow/scripts/makeblastdb.sh +++ b/workflow/scripts/makeblastdb.sh @@ -11,10 +11,10 @@ for i in $(seq 1 $ITERATIONS); do # only keep records with ott IDs, reformat the headers to retain the process ID, write to $TMP # start new file on first iteration, then append - if [[ ${i} == 1 ]]; then - egrep -A 1 'ott\d+' ${INFILE} | awk -F'|' '/^>/ {print ">"$3; next} {print}' > ${TMP} + if [ "${i}" -eq 1 ]; then + egrep -A 1 'ott[0-9]+' ${INFILE} | awk -F'|' '/^>/ {print ">"$3; next} {print}' > ${TMP} else - egrep -A 1 'ott\d+' ${INFILE} | awk -F'|' '/^>/ {print ">"$3; next} {print}' >> ${TMP} + egrep -A 1 'ott[0-9]+' ${INFILE} | awk -F'|' '/^>/ {print ">"$3; next} {print}' >> ${TMP} fi done