Interesting Bourne shell usage

Dave Sherman dave at utcsrgv.UUCP
Tue May 22 13:17:26 AEST 1984


Recently I have gotten to like using the Bourne shell for programming
on the fly - not even creating a shell file, as I did in days of old.
Today I was revising a software package in a "test" subdirectory, and
wanted a quick list of all the diffs. Then I thought I might like to
save a copy. I tried the following, and to my surprise, it worked:

$ for i in *.c
> do
> echo $i:
> echo
> diff $i ../$i
> echo
> done ^ tee junk


It was the pipe at the end that worked "to my surprise". I guess it
makes sense, since the "for" is all one command, but it was kind of unusual.

Dave Sherman
Toronto
-- 

 dave at Toronto (CSnet)
 {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave



More information about the Comp.unix mailing list