From mboxrd@z Thu Jan 1 00:00:00 1970 From: tlaronde@polynum.com Date: Tue, 13 Apr 2010 20:52:24 +0200 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20100413185224.GA1207@polynum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Content-Transfer-Encoding: quoted-printable Subject: [9fans] APE notes Topicbox-Message-UUID: 0101b7da-ead6-11e9-9d60-3106f5b1d025 Hello, These notes about APE could be of some use to others. Context : I'm verifying that my compilation framework, made for POSIX, is able to work for Plan9 too (for TeX and al.: everything works on Unix, so time to verify the whole thing on Plan9). Note: this is not a plea to add more. ape/psh is not supposed, IMO, to end in profile... - some utilities are included in POSIX.2, but are not in Plan9, including under APE : find(1), id(1), expr(1) --- of course ln(1)---.=20 These are just the ones I stumbled upon since they were used in my scripts. I have find a way, so you may find one to do differently. Note: expr(1) is typically a thing I do _not_ use, since I always feel uncomfortable with it; but I guess I wanted to "optimize" and avoid forking a "| sed ..." -> that just highlights indeed that an interpreter must have regexp handling natively =E0 la rc(1) ~. - "grep -q" (with -s) is in SUS.v3, but Plan9 has "only" traditionnal=20 "grep -s". To not be eaten by a system that has "-q" and not "-s", I=20 ended with grep ... >/dev/null 2>&1. - sed(1) does not support single character duplication : \{m,n\}---I have "unrolled" the patterns, since ".+" is not supported by POSIX sed(1) (..* does the thing in this case for example). - I have been hit by aux/getflags I think that doesn't like too many arguments (typically a sed(1) with a bunch of "-e s/.../.../g"). I have simply put the rules in a temporary file, and used sed -f. --=20 Thierry Laronde http://www.kergis.com/ Key fingerprint =3D 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C