First, let's learn how to set a variable to a value. We don't need echo and all that punctutation. Also,there is never a reason to end a line in Shell with a semi-colon. For readability while testing let's indent our code and build in some diagnostic echo statements:
READS1=45
READS2=100
READS3=$((2 * ${READS2}))
echo "READS1=${READS1}"
echo "READS2=${READS2}"
echo "READS3=${READS3}"
if [ ${READS1} -gt ${READS3} ]
then
echo "gleich"
else
echo "ungleich"
fi
./scriptname
READS1=45
READS2=100
READS3=200
ungleich
Hmm. Doesn't German ungleich mean English unequal ?
ok thank you, the firsthint helped me.
I know that it was not neccessary to make the a=`echo 45` statement. bus I thought there might be some type-difference? are there any types in the bash? a la integer vs. string??
thanks a lot
---------- Post updated at 06:07 PM ---------- Previous update was at 06:02 PM ----------
Most of the time the Shell will deduce the type according to context. There is a small efficiency benefit from using the Shell typeset command which will be described in the manual for your Shell.