[OpenWrt-Devel] [PATCH 3/7] base-files/functions.sh: use command -v instead of $(which)

Felix Fietkau nbd at nbd.name
Fri Jan 17 04:06:32 EST 2020


On 2020-01-17 05:43, Rosen Penev wrote:
> $(which) must be executed. command -v is a shell builtin.
> 
> https://github.com/koalaman/shellcheck/wiki/SC2230
> 
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  package/base-files/files/lib/functions.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
> index 0e94162a1a..a8a4734413 100755
> --- a/package/base-files/files/lib/functions.sh
> +++ b/package/base-files/files/lib/functions.sh
> @@ -176,7 +176,7 @@ default_prerm() {
>  		ret=$?
>  	fi
>  
> -	local shell="$(which bash)"
> +	local shell="command -v bash"
You dropped the $() there, that looks wrong to me.

- Felix

_______________________________________________
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