[arch-projects] [PATCH] [mkinitcpio] init: Remove sed cmd usage

Dave Reisner d at falconindy.com
Wed Nov 16 08:33:00 EST 2011


On Tue, Nov 15, 2011 at 10:10:39PM -0300, Gerardo Exequiel Pozzi wrote:
> Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
> ---
>  init |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/init b/init
> index 25a51eb..943fa9a 100644
> --- a/init
> +++ b/init
> @@ -38,7 +38,7 @@ else
>  fi
>  
>  if [ -n "${disablehooks}" ]; then
> -    for d in $(echo "${disablehooks}" | sed 's|,| |g'); do
> +    for d in ${disablehooks//,/ }; do
>          eval "hook_${d}=disabled"
>      done
>  fi
> -- 
> 1.7.7.3
> 

You can go one step further and rip out the -n test. A for list element
for a for loop that only expands to whitespace has zero length as far as
iteration is concerned.

d
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20111116/e5a12286/attachment.asc>


More information about the arch-projects mailing list