Re: Ping an ip address range



Janis Papanagnou wrote:

On 26.05.2011 12:51, Radoulov, Dimitre wrote:
On 26/05/2011 09:12, Janis Papanagnou wrote:

Is $(( k += 1 )) meanwhile standard? I thought that would be

k=$(( $k + 1 ))

If I read it correctly, now it *is* standard:

If the shell variable x contains a value that forms a valid integer constant,
then the arithmetic expansions "$((x))" and "$(($x))" shall return the same
value.

That's one aspect; x vs. $x inside $((...)). Another one, IIRC, had been
(un-)availability of operator += and (I think) also the assignment within
the $((...)) vs. outside. (I may be misremembering, though.)

The += and other assignment operators have always been mandated by
POSIX. What wasn't clear in older revisions of the standard was
whether an assignment to a shell variable inside an arithmetic
expansion has to be reflected in the value of the variable after the
expansion. I quoted the new text that clarifies this in my other post
in this thread.

--
Geoff Clare <netnews@xxxxxxxxxxxxx>

.



Relevant Pages

  • Re: Copying pthread_t
    ... With respect to what the standard says, ... the pthreads standard makes it undefined ... Assignment operators for 'pthread_t' ...
    (comp.programming.threads)
  • Re: hubbles constantly expanding universe
    ... > So even without gravity, your body, the earth and moon, etc. would all ... Of course without gravity the ... > world such expansion of the universe would be unobservable. ... You cited platinum for a length standard (just as a "for instance" I'm ...
    (sci.physics.relativity)
  • Re: [C, C++] "(a=b) = c;" Illegal or Undefined?
    ... What part of the standard says that the second assignment happens after ... For better or worse, however, the standard disagrees. ... standard doesn't specify a sequence point that prevents it. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: C header files--Urgent
    ... an "impossible assignment" for you. ... compiler from unix to windows and compiler is written partially in c ... If they are standard header files then ...
    (comp.lang.c)
  • Re: difference between pointers
    ... Nothing in the C standard says or implies ... the assignment is a constraint violation, ...
    (comp.lang.c)