[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
signature.asc
Description: PGP signature
- Re: [PATCH 2/4] Indent maybe_os stuff ahead of refactor, John Ericson, 2018/05/01
- Re: [PATCH 2/4] Indent maybe_os stuff ahead of refactor, Ben Elliston, 2018/05/02
- Re: [PATCH 2/4] Indent maybe_os stuff ahead of refactor, John Ericson, 2018/05/02
- [PATCH 1/2] * config.sub: Properly recognise configs with 4 components, John Ericson, 2018/05/02
- [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, John Ericson, 2018/05/02
- Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 components,
Ben Elliston <=
- Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 components, John Ericson, 2018/05/04
- [PATCH 1/2] * config.sub: Properly recognise configs with 4 components, John Ericson, 2018/05/04
- [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, John Ericson, 2018/05/04
- Re: [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, Ben Elliston, 2018/05/05
- Re: [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, John Ericson, 2018/05/11
- Re: [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, Ben Elliston, 2018/05/11
- Re: [PATCH 2/2] * config.sub (arm*-*-none-eabi): Recognise, John Ericson, 2018/05/11
- Re: [PATCH 1/2] * config.sub: Properly recognise configs with 4 components, Ben Elliston, 2018/05/05