From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Wed, 12 Dec 2007 11:04:17 +0000 From: "roger peppe" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] rc: token buffer too short In-Reply-To: <74D6B736-B261-44EC-B2AF-86ACC35E971A@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <33F4A474-6B5E-4A40-8361-A131770B900F@mac.com> <20071201190953.GA788@shodan.homeunix.net> <74D6B736-B261-44EC-B2AF-86ACC35E971A@mac.com> Topicbox-Message-UUID: 160a2ce6-ead3-11e9-9d60-3106f5b1d025 On Dec 11, 2007 7:46 PM, Pietro Gagliardi wrote: > Not in this case, no. The format of awk is > > awk 'program' files > awk -f prgm files > > What I could do instead is > > u=/tmp/$0$pid$apid$0 > cat > $u <<\END > program > END > awk -f $u $* > rm $u > > but I'd rather not go that way to avoid possible collisions. actually, you could use a here file and a named pipe: awk -f <{cat << 'EOF'} $* program EOF i do think that a quoted argument should be able to take an arbitrary amount of text though. > Here's another problem. The error check function cats to [1=2]. > However, instead of going to standard output, it makes a file [1=2] > and writes the message there. How do I fix this? awk uses ape/sh to run its commands, so you can fix it by using >&2 as under unix. On Dec 12, 2007 10:14 AM, Douglas A. Gwyn wrote: > Another similar approach would be for the open of a new special > file to create a unique temp file, which would vanish upon final > close, and have the app share/clone the file descriptor, which > could be dup2()ed (or whatever Plan9 equivalent is) to stdout, > stdin, etc., for the various processes in your script. that's similar to the named-pipe approach, except that you can't seek on named pipes. i often find myself mounting a new instance of ramfs, thus getting rid of the problem in most cases (the exception being if you don't want to fork the namespace).