>>>>> "Shrestha" == Shrestha <[EMAIL PROTECTED]> writes:
Shrestha> In shell programming in linux, if I want to do something if the number is 3
then I can write
Shrestha> if [$numb ="3"]
Shrestha> then
Shrestha> echo "hello"
Shrestha> fi
Shrestha> But if I have to write a condition "greater that 3 and less than 10", how do
I write it?
Shrestha> Any help will be highly appreciated!!!
if [ $x -gt 3 -a $x -lt 10 ]
then
echo $x
fi
(the
if [ $x = "3" ]
line does a string comparison.
)
Do `man test' to get lots of other goodies you can test on.
PeterC
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text