Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!swbatl!texbell!sugar!ficc!peter From: peter@ficc.ferranti.com (peter da silva) Newsgroups: comp.unix.questions Subject: Re: C-shell programming Keywords: csh, multiple file input Message-ID: Date: 9 Aug 90 17:18:58 GMT References: <230@jabberwock.shs.ohio-state.edu> <3039@awdprime.UUCP> <235@jabberwock.shs.ohio-state.edu> Distribution: usa Organization: Ferranti International Controls Corporation Lines: 18 (a) The Bourne shell is a *much* better programming tool. Why are you using the C shell for scripts? (b) The "join" command could be used to make a pipeline out of this. #!/bin/sh # If not already sorted: for i in 1 2 3 do sort -d NN.dat$i > NN.sort$i done join -j 1 -o 1.1 1.2 1.3 2.2 2.3 NN.sort1 NN.sort2 | join -j 1 -o 1.1 1.2 1.3 1.4 1.5 2.2 2.3 - NN.sort3 | awk '{print $1"/"$2"/"$3"/"$4"."$5"."$6" "$7}' Appropriate use of /dev/fd could make it even neater, if you don't already have sorted files. -- Peter da Silva. `-_-' +1 713 274 5180. 'U`