[OpenWrt-Devel] [PATCH] ubox: Run init script through shellcheck
Rosen Penev
rosenp at gmail.com
Wed Jul 24 13:56:04 EDT 2019
On Wed, Jul 24, 2019 at 10:50 AM Petr Štetiar <ynezz at true.cz> wrote:
>
> Rosen Penev <rosenp at gmail.com> [2019-07-24 10:32:31]:
>
> > SC2004: $/${} is unnecessary on arithmetic variables.
> > SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
>
> Can you please provide some details, why should we care about this shellcheck
> warnings ?
>
> > - PIDCOUNT="$(( ${PIDCOUNT} + 1))"
> > + PIDCOUNT="$(${PIDCOUNT} + 1)"
>
> You maybe fixed warning, but introduced bug:
>
> $ PIDCOUNT=2 echo "$(${PIDCOUNT} + 1)"
> /bin/ash: 2: not found
>
> So that shellcheck thingy probably wanted:
>
> PIDCOUNT="$((PIDCOUNT + 1))"
Correct. WIll send a v2.
>
> -- ynezz
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list