From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Wed, 20 Jul 2011 00:05:26 +0200 Subject: [U-Boot] [PATCH 2/3] mkconfig: create CONFIG_ defines without relying on GNU extensions In-Reply-To: References: <1311108110-37409-1-git-send-email-jeroen@myspectrum.nl> <1311108110-37409-3-git-send-email-jeroen@myspectrum.nl> <4E25F6E7.5080907@myspectrum.nl> Message-ID: <4E25FFA6.9090706@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Mike, >> Won't work on FreeBSD since it can't quite early [afaik] (perhaps with a >> label, but gets rather ugly..) >> >> [jeroen at blue ~]$ echo configflag | sed -e '/=/{s/=/\t/;q}' -e 's/$/\t1/' >> sed: 1: "/=/{s/=/\t/;q} >> ": extra characters at the end of q command > i'm not sure you've diagnosed the problem correctly. the fact that > the output says "end of q command" indicates that FreeBSD does support > the "q" command (as required by POSIX). > I didn't apparently.. > perhaps the problem is that the ";" extension to separating commands > (which is not in POSIX afaics) does not work the same in FreeBSD's sed > as GNU's sed. i imagine if you stick a ";" after the "q" command > it'll work ... > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html > -mike Yes, the ; does work as expected, thanks! [jeroen at blue ~]$ echo config | sed -e '/=/{s/=/ /;q;}' -e 's/$/ 1/' config 1 [jeroen at blue ~]$ echo config=2 | sed -e '/=/{s/=/ /;q;}' -e 's/$/ 1/' config 2 Shall change the patch accordingly tomorrow. Regards, Jeroen