Article View: comp.unix.shell
Article #1107Re: How to do <cmd> file | hold file
From: Dan Bernstein
Date: Sun, 09 Sep 1990 03:14
Date: Sun, 09 Sep 1990 03:14
16 lines
1094 bytes
1094 bytes
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 "<cmd line> <file>". > 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
Technical Details
Message-ID:
<8147:Sep903:14:3990@kramden.acf.nyu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstndReferences:
<1990Sep8.054623.3822@sj.ate.slb.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 <cmd> 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