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


_______________________________________________
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches

Reply via email to