[systemd-devel] [PATCH 12/12] Add mock fsck process
Didier Roche
didrocks at ubuntu.com
Thu Jan 29 09:49:00 PST 2015
Le 28/01/2015 17:13, Martin Pitt a écrit :
> 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.
>
Yeah, there are some bashims. If getting POSIX shell is important for
the mock, I'm happy to do the necessary changes.
Didier
More information about the systemd-devel
mailing list