Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unix – How can I resolve :command not found

I have 2 scripts test1.sh & test2.sh, below is the defn. for the same

cat test1.sh


DUP_CHK=`beeline --showHeader=false --outputformat=tsv2 -e "select count(*) from table1"`

echo "$DUP_CHK"
export DUP_CHK 

cat test2.sh

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

#!/bin/bash


source ./test1.sh

cnt_chk="$DUP_CHK"
cnt_chk_2=`beeline --showHeader=false --outputformat=tsv2 -e "select count(*) from table1"`

echo "$DUP_CHK"
echo "$cnt_chk"
echo "$cnt_chk_2"

if "$cnt_chk -eq $cnt_chk_2"
     then
       echo "You are right"
       exit 0
else
    echo "Something is not right, check"
    exit  0
fi

I am passing both value as same but, the error throws as
test2.sh: line 18: 100 -eq 100: command not found

What am I missing here. Thoughts?? Thanks.

>Solution :

You need

  if((cnt_chk == cnt_chk2))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading