config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 compone


From: Ben Elliston
Subject: Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 components
Date: Fri, 4 May 2018 14:03:19 +1000
User-agent: Mutt/1.5.24 (2015-08-30)

Hi John

On Tue, May 01, 2018 at 02:53:46PM -0400, John Ericson wrote:

> +# Physical components of config
> +comp1=`echo "$1" | sed 's/^\([^-]*\).*$/\1/'`
> +comp2=`echo "$1" | sed 's/^[^-]*-\([^-]*\).*$/\1/'`
> +comp3=`echo "$1" | sed 's/^[^-]*-[^-]*-\([^-]*\).*$/\1/'`
> +comp4=`echo "$1" | sed 's/^[^-]*-[^-]*-[^-]*-\([^-]*\).*$/\1/'`

Can you please rework your patch with something like this, and then we
can ditch the nasty sed expressions above completely:

IFS="-" read comp1 comp2 comp3 comp4 <<EOF
$1
EOF

(bash has here-strings which would be nicer still, but they are not
portable enough.)

Thanks,
Ben

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]