Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

-eq shell script

a=30
b=20
if [[ $a -eq $b ]]; then
    echo "Match"
else
    echo "No Match"
fi

Output:No Match
=================================================
a=John
b=George
if [[ $a -eq $b ]]; then
    echo "Match"
else
    echo "No Match"
fi

Output:Match
which is wrong

Conclusion:
-eq is for numerical comparison and == is for string comparison
Comment

PREVIOUS NEXT
Code Example
Shell :: rename multiple files in terminal 
Shell :: jekyll new site 
Shell :: when hostname ansible 
Shell :: bash maximum running time 
Shell :: revert changes to all files of a type git 
Shell :: how to find zero byte files 
Shell :: Git Error: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
Shell :: mac send email attachment command line 
Shell :: redis mac 
Shell :: YCM core library not detected 
Shell :: scp local to ssh aws 
Shell :: git merge local branch 
Shell :: batch call another batch with parameters 
Shell :: kde vs gnome 
Shell :: windows commandline zip 
Shell :: input prompt in command line 
Shell :: unzip 7z cli 
Shell :: pi disable ssh warning 
Shell :: git commit message conventions 
Shell :: gitignore httaccess 
Shell :: cp exclude file 
Shell :: where powershell 
Shell :: git delete commit 4785cd1e041 
Shell :: kubernetes get node taints 
Shell :: Update in fedora before installs 
Shell :: add new domain again with certbot 
Shell :: bash convert seconds to date 
Shell :: remove directory command line 
Shell :: how to run pkg file on mac terminal 
Shell :: access django admin 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =