Is there a package a need to install to use operators with Bash?

Viewed 26

I am trying to transfer a pipeline from one server to another one. I am having some issues with some of the bash scripts in the new server and I was wondering if there is any package that I need to install to get around them.

For example I have a script that looks like this:

#!/bin/bash -l
#$ -cwd
# file name: pipeline.sh

code="path_to_code" 
# fastq files
f1=$2 # R1
f2=$3 # R2
    

# libType = N or S
findType1=`echo $f1 | grep "ONE\|TWO\|THREE" | wc -c`
findType2=`echo $f1 | grep "FOUR\|FIVE\|SIX" | wc -c`

if [[ $findType1 -gt 0 ]]; then
    libType="S"
elif [[ $findType2 -gt 0 ]]; then
    libType="N"
else
    echo "unable to determine the library type of $f1 - exitting!"
    exit 12
fi
echo $libType
echo $f1
echo $f2
  
# SE (single end) 
if [[ $f2 == "" ]]; then
     sh $code/Mapping.sh -l "$libType" -f "$f1" -p "NA" 
else
     sh $code/Mapping.sh -l "$libType" -f "$f1" -p "$f2" 
fi

On the old server this script works fine. However, to get it to work on the new server I had to replace any "[[" with "[". In addition, I had to replace "==" with "=". Can anyone tell me why I am having these issues?

I have tried running the script both as sh path/to/script.sh and as bash path/to/script.sh but I am getting the same error.

Thank you

0 Answers
Related