Interesting Bourne shell usage, and ^ for pipe

59577 wcs at ho95b.UUCP
Fri May 25 03:40:01 AEST 1984


Dave Sherman posted a quick shell program, containing:
    $ for i in *.c
    > do
    ......
    > done ^ tee junk

What interested me about this was the use of the ^caret 
as a pipe symbol, instead of the | vertical bar.  This is kind
of an archaism;  the Korn Shell (ksh) has dropped it, although
the System V shell still supports it.  Do many people out there
use ^ ?  I much prefer the ability to say
	grep ^joeuser /etc/passwd
without being told
	sh: joeuser: not found

Another note on this is that /bin/sh forks off a process to do
the for loop when directing its output to a pipe; ksh doesn't.
This feature, and builtins for echo and expr considerably speed
up shell script execution in ksh.

				Bill
-- 
The virtual keyboard of:
				Bill Stewart
				AT&T Bell Labs, Holmdel NJ
				...!ihnp4!ho95b!wcs



More information about the Comp.unix mailing list