dimanche 28 décembre 2014

String comparison in if statement

I have the following Bash script, but I get an error in the predicate of my if statement. What am I doing wrong?



#!/bin/bash
$UQ = "noqueue:"
read -p "Aadress: " email
id=$(grep $email mx.log | grep status | awk '{print $6 }')
read b <<<$id read
a <<<$email

if (($id == $UQ ));
then
grep $email mx.log
else
for((i=0;i<${#a[@]};i++)); do
for ((j=0;j<${#b[@]};j++))
do
c+=(${a[i]}:${b[j]});
done
done
for i in ${c[@]} do
echo $i
done
fi

Aucun commentaire:

Enregistrer un commentaire