Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does "If [ greater or equal to] work in ksh 1

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
US

value=25
If [ value = 25 ]
then...
# this works OK

But also in ksh

If [ value -gt 24 ]
then....

# does not work. Any advice please?

Is -lt or -gt not vaid in ksh?
 
Perhaps this ?
If [ [!]$[/!]value -gt 24 ]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
In addition to PHV's answer:
There seems to be a bug in your first example;
you are testing if strings "value" and "25" are the same ...
 
Thanks for your help and apologies for the typos.
 
Now working, needed VARIABLE as suggested, thanks again for reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top