This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ 3 -eq 3 -a 3 -ge 2 ] | |
then | |
echo "work begins"; | |
fi | |
if [ ! 3 -ge 4 ] | |
then | |
echo "! 3>4"; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=5; | |
echo $((1+2)); | |
echo $(($i-3)); | |
echo $((7/2)); | |
echo $((7%5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 1 2 3 4 5 6 | |
do | |
echo $i; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
while [ $i -lt 10 ] | |
do | |
echo $i; | |
i=$((i+1)); #increment the varaible i | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $a -eq $b ] # -eq tests whether left operand is equal to the right operand | |
then | |
echo "a is equal to b" | |
else | |
echo "a and b are not equal" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numberVariable=3; | |
realVariable=3.14; | |
stringVariable_1=pi; | |
stringVariable_2="pi"; |
NewerOlder