On Jul 6, 2006, at 4:44 AM, Cameron Simpson wrote:

> On 05Jul2006 21:50, sarvin <[EMAIL PROTECTED]> wrote:
> | I'm trying to learn bash shell scripting, by writing a script, using
> | an array. I'm finding plenty of information about arrays but nothing
> | about making elements within an array integers.
> |
> | I'm trying to make a while loop with
> |
> | count=1
> | chapter=1
> | amount=( 50 40 27 36 34 )
> |
> | while [ $chapter -le ${amount[$count]} ]; do
> |
> | I'm getting the error "[: 51: unary operator expected"
>
> Try running your script with the -x option. You can have the script  
> turn
> it on like this:
>
> set -x
> count=1
> chapter=1
> amount=( 50 40 27 36 34 )
> while [ $chapter -le ${amount[$count]} ]; do
>
> See what [ ..... ] command is actually issued - that will reveal  
> how the
> "[" (test) command is being issued, and hopefully point the way to the
> problem.
>
> Cheers,
> -- 
> Cameron Simpson <[EMAIL PROTECTED]> DoD#743
> http://www.cskk.ezoshosting.com/cs/
>
> People who write "obtuse" to mean a mixture of "obscure" and  
> "abstruse" are
> displaying their own obtuseness. - Eric Minch  
> <[EMAIL PROTECTED]>

Thanks I found the problem with "set -x" and it was completely  
unrelated.


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/0XFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be 
removed. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/LINUX_Newbies/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to