Dec 29, 2006 #1 marrow Technical User Joined Jul 20, 2001 Messages 425 Location 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?
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?
Dec 29, 2006 1 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR 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 Upvote 0 Downvote
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
Dec 29, 2006 #3 hoinz MIS Joined Jan 29, 2004 Messages 944 Location DE 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 ... Upvote 0 Downvote
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 ...
Dec 29, 2006 #4 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi In addition, please write the [tt]if[/tt] with lowercase i. Looks better on a forum for computer professionals. Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi In addition, please write the [tt]if[/tt] with lowercase i. Looks better on a forum for computer professionals. Feherke. http://rootshell.be/~feherke/
Dec 29, 2006 Thread starter #5 marrow Technical User Joined Jul 20, 2001 Messages 425 Location US Thanks for your help and apologies for the typos. Upvote 0 Downvote
Dec 31, 2006 Thread starter #6 marrow Technical User Joined Jul 20, 2001 Messages 425 Location US Now working, needed VARIABLE as suggested, thanks again for reply. Upvote 0 Downvote