[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warning (HTML included to show prog shipped w/syntax highlighting).
From: |
Chet Ramey |
Subject: |
Re: Warning (HTML included to show prog shipped w/syntax highlighting). |
Date: |
Wed, 10 Aug 2011 20:08:07 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 |
On 8/10/11 6:23 PM, Linda W wrote:
>
>
> When I have the construct, in 4.1:
>
>
> 1 #!/bin/bash
> 2 30 31 # trace control for subs
> 32 declare -ix Allow_Trace=$(((
> 33 _D_LowLevel |
> 34 _D_Provides |
> 35 _D_ 36 )))
> 37 38 declare -ix Trace_off=$(((
> 39 _D_
> 40 )))
> 41 42 # for setting a local '_Debug' flag in a routine
> 43 declare -ix Debug=$(((
> 44 _D_
> 45 )))
> 46 47 907 # vim: ts=2 sw=2 fdm=marker nofen
>
>
> The syntax highligher doesn't like my ) brace.
>
> If I put a space after $( and before th final ), then the error goes away,
> but it changes
> the semantics of the statment (one does an arith cal, and reurns value, but
> with spaces,
> it does the arith and returns the status of the of wheither or not the
> 'calc' returned 0 (fail)
> or 1(pass).
>
> For hosethat want to complain about HTML, bing used on vim llist -- - just
> ignore the post..
>
>
> Is this fixable???
You have to decide: do you want command substitution or arithmetic
expansion? If it's the former, write it that way using $( ... ); if
the latter, make it clear using $(( ... )). You'll thank yourself later.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/