Zbigniew Jędrzejewski-Szmek [2015-01-28 16:08 +0100]:
> > +#!/bin/bash
> I think you can change this to /bin/sh, I don't see any bashisms.
> 
> > +declare -a maxpass=(30 5 2 30 60)

I do :-) POSIX shell doesn't have arrays AFAIK, and declare -a
definitively doesn't work in e. g. dash.

> > +for pass in {1..5}; do
> > +    maxprogress=${maxpass[$((pass-1))]}

That said, if using POSIX shell is a concern (probably not for this
little test dummy), this could certainly be rewritten to something
like

  pass=0
  for maxprogress in 30 5 2 30 60; do
      pass=$((pass+1))

which isn't really more complicated and avoids arrays.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to