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

shell -eq

-eq is for numerical comparison and == is for string comparison
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
Comment

PREVIOUS NEXT
Code Example
Shell :: cmd mac pdf reader 
Shell :: Numeric calculations 
Shell :: Set $FOO to val if unset (or null) 
Shell :: nginx dompdf error 
Shell :: mac os tild operator 
Shell :: close all open windows macos 
Shell :: get file from branch git 
Shell :: NGINX setup for react plus django (rest framework) in same server 
Shell :: command to get back shell variable from environment variable 
Shell :: remove watermark in video in filmora 
Shell :: change directory in linux 
Shell :: git stash pop specific 
Shell :: To install the GNOME desktop environment 
Shell :: postgre create user 
Shell :: ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied 
Shell :: github commands 
Shell :: ubuntu extract .tar.xz file 
Shell :: Running Graphical Programs on Windows Subsystem on Linux 
Shell :: install kubectl on ubuntu 20 
Shell :: awk or statement 
Shell :: how to access kafka command in docker 
Shell :: install ignite-cli 
Shell :: pip install pytorchvideo_trainer 
Shell :: activer core dumped linux 
Shell :: ubuntu upgrade versionScaricamento delle informazioni del repository non riuscito Controllare la propria connessione a Internet. 
Php :: How to Log Query in Laravel 
Php :: laravel back button 
Php :: php artisan serve port 
Php :: : Unable to locate package php7.4-fpm 
Php :: Unable to resolve NULL driver for [MaatwebsiteExcelTransactionsTransactionManager]. 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =