#!/bin/bash
a=100
b=150
if [ $a == $b ]
then
echo "a==b"
elif [ $a -gt $b ]
then
echo "a > b"
elif [ $a -lt $b ]
then
echo "a < b"
else
echo "a b not known"
fi
Output results:
a < b
Read More:
- In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment
- Shell script running error bash: JPS: command not found
- Solve the problem of shell script “syntax error near unexpected token `fi’”.
- Shell script: syntax error: bad for loop variable error resolution
- The shell script exits after an error is reported
- Error BC: command not found when git bash runs shell script
- The method of getting shell command output in Python
- Shell script syntax error near unexpected token ‘$’Do
- Differences between shell script variable assignment and C language variable assignment
- When executing shell script, $’r ‘: command not found appears
- Shell script – EQ – Ne – GT – LT – ge – le
- Solution to shell script invocation error during Xcode real machine test
- Solution to the error $’\ R’: command not found when executing shell script under Linux
- Typeerror: write() argument must be STR, not bytes and the method of writing binary file in Python 3
- Typeerror: write() argument must be STR, not bytes and the method of writing binary file in Python 3
- Shell script execution error: “syntax error near unexpected token”
- Solution to shell script error “expr: syntax error”
- Common shell (1): shell gets the current time stamp of the system
- The difference between single equal sign and double equal sign EQ in shell script
- Exponentiation in shell