[csw-maintainers] solaris history question

Dagobert Michelsen dam at opencsw.org
Tue Aug 25 12:35:45 CEST 2009


Hi Ben,

Am 24.08.2009 um 03:04 schrieb Ben Walton:
> I've discovered an interesting bit of solaris archaeology today and I
> wanted to ask those with longer solaris memory why such a thing is
> still supported.
>
> Long before I ever encountered a shell, ^ was the symbol used to
> separate commands in a pipeline.  It seems that solaris' /bin/sh is
> still allowing this in some cases.  The following script demonstrates
> it.
>
> --snip--
> #!/bin/sh
>
> LESS=
> export LESS
>
> ( echo test1
>    echo test2
>    echo test3 )^
> /opt/csw/bin/ggrep 2
>
> echo test^
> /opt/csw/bin/less
> --snip--
>
> The word 'test2' is spit out by ggrep and the word 'test' is sent to
> the stdin of less.
>
> Can someone provide some history on this?  It's fascinating (to me) as
> a bit of lore from bygone days.

This is very interesting. /bin/sh seems to be the only shell  
exhibiting this
behaviour, /usr/xpg4/bin/sh (the standard compliant shell) does not.

 From O'Reilleys "Learning the BASH shell":

> bash is almost completely backward-compatible with the Bourne shell.  
> The only
> significant feature of the latter that bash doesn't support is ^  
> (caret) as a
> synonym for the pipe (|) character. This is an archaic feature that  
> the Bourne
> shell includes for its own backward compatibility with earlier  
> shells. No modern
> UNIX version has any shell code that uses ^ as a pipe.

So, either the authors are not well informed, or Solaris 10 is not a  
modern unix ;-)

After reading a bit more I learned that this was already in the  
precursor of the Bourne
Shell, the "Thompson Shell" provided with Unix v4:
   <http://en.wikipedia.org/wiki/Thompson_shell>
This must have been sometime after 1971, the year I was born 8-)


Best regards

   -- Dago




More information about the maintainers mailing list