[petsc-dev] do syntax

Jed Brown jed at 59A2.org
Tue Mar 2 08:42:22 CST 2010


On Tue, 2 Mar 2010 07:32:16 -0600, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> >>> $ for i in {1..5}; do
> >>>> echo $i
> >>>> done
> >>> {1..5}
> 
> 
> This notation does not appear to be portable to sh, so we've had to  
> change it back to listing 1 2  etc.

"seq" is more common than bash

  for i in `seq 1 5`; do

but still not available everywhere.  On this note, I see the use of
$[expr] which is definitely less portable than $((expr)), but neither of
which are mandated.  I suppose the arithmetic could be done with "bc",
which at least is part of POSIX.  Or with python -c ...

Jed



More information about the petsc-dev mailing list