Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.shell Subject: Re: How to do file | hold file Message-ID: <8147:Sep903:14:3990@kramden.acf.nyu.edu> Date: 9 Sep 90 03:14:39 GMT References: <1990Sep8.054623.3822@sj.ate.slb.com> Organization: IR Lines: 16 In article <1990Sep8.054623.3822@sj.ate.slb.com> fabrice@sj.ate.slb.com writes: > I use the following C-shell alias to get the output of a command into > the file it applies to. The command should be of the form " ". > alias apply \!\* \> /tmp/apply.\$\$ \; cp /tmp/apply.\$\$ \!\$ Much better is % alias transform '(rm \!:1;\!:2* > \!:1) < \!:1' which is used as, e.g., % transform foo.c grep -v '^/\*###' to strip comments inserted by error(1). It doesn't demand a temporary file. It can release the disk space of the original as soon as the command closes it. And it doesn't pass foo.c as an argument if the command is just a filter. ---Dan