Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, in bash scripting, write if cluase where you already have two vars, x and y, and you print "great" if x is greater than y, "less" if x is smaller than y, and "equal" otherwise.
Answer
if [ $x -gt $y ]; then
    echo "great"
elif [ $x -lt $y ]; then
    echo "less"
else
    echo "equal"
fi

Question
In linux, in bash scripting, write if cluase where you already have two vars, x and y, and you print "great" if x is greater than y, "less" if x is smaller than y, and "equal" otherwise.
Answer
?

Question
In linux, in bash scripting, write if cluase where you already have two vars, x and y, and you print "great" if x is greater than y, "less" if x is smaller than y, and "equal" otherwise.
Answer
if [ $x -gt $y ]; then
    echo "great"
elif [ $x -lt $y ]; then
    echo "less"
else
    echo "equal"
fi
If you want to change selection, open document below and click on "Move attachment"

7. Shell Scripting
its full form can contain as much as: 5 X=10 Y=5 if test "$X" -gt "$Y" ; then echo "$X is greater than $Y" elif test "$X" -lt "$Y" ; then echo "$X is less than $Y" else echo "$X is equal to $Y" <span>fi Now let us create a script that interprets its arguments. Create a new script called backup-lots.sh , containing: #!/bin/sh for i in 0 1 2 3 4 5 6 7 8 9 ; do cp $1 $1.BAK-$i done Now cr

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.