bash compare numbers
#!/bin/bash
# Script to do numeric comparisons
var1=10
var2=20
if [ $var2 -gt $var1 ]
then
echo "$var2 is greater than $var1"
fi
# Second comparison
If [ $var1 -gt 30]
then
echo "$var is greater than 30"
else
echo "$var1 is less than 30"
fi# In bash, you should do your check in arithmetic context:
if (( a > b )); then
...
fi
# For POSIX shells that don't support (()), you can use -lt and -gt.
if [ "$a" -gt "$b" ]; then
...
fibash if greater thanShell/Bash By Me (Armandres) on Feb 18 2021 DonateDeleteEdit
if (( a > b )); then
...
fi
#Use above example or below one:
if [ "$a" -gt "$b" ]; then
...
fi
Also in C++:
- uploading a folder to github
- if in shell script
- rror: src refspec master does not match any. error: failed to push some refs to 'https://git.heroku.com/thawing-retreat-68019.git'
- how to add a path variables in linux
- afficher l'heure .bat
- init step way to create repository git
- vscode Module 'cv2' has no 'imshow' member
- docker run restart always
- iis stop
- how to ignore folder in gitignore duplicate
- android logs for app on terminal
- how to install steam on ubuntu
- run newly installed chrome from terminal linux
- origin branch still showing in vscode though deleted
- git delete all local branches
- how to run a .bin file in linux
- windows run powershell script from task scheduler
- gitignore a specific file
- cp exclude file
- fuser install linux
- ubuntu can't locate packages
- echo with new lines bash
- pip2 install tensorflow 1.15
- install guake ubuntu