[arch-projects] [PATCH 5/7] standardize syntax in [[ and ((

Seblu seblu at seblu.net
Sat Mar 26 20:21:23 EDT 2011


On Sat, Mar 26, 2011 at 9:32 PM, Dave Reisner <d at falconindy.com> wrote:
> * checks for variable existance should not use -n or quotes
> * avoid using -eq, this is what arithmetic expansion is for
> * always quote the LHS of a [[
why?

> * always quote proper arrays expanded with @
why too?

> diff --git a/network b/network
> index 5a261b4..27df68a 100755
> --- a/network
> +++ b/network
> @@ -69,7 +69,7 @@ ifdown() {
>  }
>
>  iflist() {
> -       for ifline in ${INTERFACES[@]}; do
> +       for ifline in "${INTERFACES[@]}"; do
>                if [[ $ifline = ${ifline#!} ]]; then
here you miss quoting LHS, no?


-- 
Sébastien Luttringer
www.seblu.net


More information about the arch-projects mailing list