Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!ucscc!ucscb.bitbug@ucbvax.Berkeley.EDU From: ucscb.bitbug@ucbvax.Berkeley.EDU Newsgroups: comp.unix.questions Subject: Re: Append file commands for Unix & ex/vi Message-ID: <2275@brl-adm.ARPA> Date: Mon, 12-Jan-87 08:13:44 EST Article-I.D.: brl-adm.2275 Posted: Mon Jan 12 08:13:44 1987 Date-Received: Mon, 12-Jan-87 21:46:27 EST Sender: news@brl-adm.ARPA Lines: 32 >From: "John Wright/Dr. Pat Lane" >Date: 11 Jan 87 15:15:09 GMT >Keywords: append command unix ex vi >To: info-unix@brl-sem.arpa > > >Is there a way to append a range of text to a file from vi/ex (as opposed >to 'w' which writes or over-writes)? Yes. In escape mode, type !cat >> file Where is ! for present line, G for to end of file, } to end of paragraph, etc. > >Are there simple Unix commands to append files with syntax and action similar >to 'cp' and 'mv'. I developed the following alii and I'm wondering if they >are necessary: > alias append cat !:1 >>!:2`test -d !:2 && echo /!:1` > alias tack append !:1 !:2 && rm !:1 > > (I would accept suggestions on a better name for the latter!) With the append (>>) operator in sh and csh, I don't see why you would want or need a command to append one file to another. The syntax it appears you want is "append file1 file2". Such a program would be quite easy to write. You already have.