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 componen


From: John Ericson
Subject: Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 components
Date: Fri, 4 May 2018 14:40:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

That's a wonderful idea; thanks! I'll redo.


On 05/04/18 00:03, Ben Elliston wrote:
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




reply via email to

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