Sponsored Content
Full Discussion: Hi all
Top Forums Shell Programming and Scripting Hi all Post 302269709 by ma466 on Thursday 18th of December 2008 10:37:29 AM
Old 12-18-2008
I try the way you told me but getting the following error

# ./robot.ksh
++ TRY=1
++ word1=
./robot.ksh: line 16: syntax error in conditional expression
./robot.ksh: line 16: syntax error near `-a'
./robot.ksh: line 16: `while [[ TRY -lt 4 -a "$word1" != "slot" ]]'
#




Quote:
Originally Posted by zaxxon
1. Such nonthing saying subjects normally get you an infraction. Rules are to use senseful subjects.
2. Please use code tags. It's no fun reading such scripts with no formatting. I edited your post - it now has code tags.
3. Please try it again with doube square brackets like:
Code:
while [[ $ERRORCODE -gt 0 -a $TRY -lt 4 ]]

4. Also to be sure maybe start using variables in this form:
Code:
${VAR}

5. Use set -x to debug your script
6. Use echo on your variables to debug your script
 
let(1)                                                             User Commands                                                            let(1)

NAME
let - shell built-in function to evaluate one or more arithmetic expressions SYNOPSIS
ksh let arg... DESCRIPTION
ksh Each arg is a separate "arithmetic expression" to be evaluated. EXIT STATUS
The following exit values are returned: 0 The value of the last expression is non-zero. 1 The value of the last expression is zero. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), set(1), typeset(1), attributes(5) SunOS 5.10 15 Apr 1994 let(1)
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy