That Crazy Caret

mlip at NADC.ARPA mlip at NADC.ARPA
Sat Sep 8 00:40:25 AEST 1984


[ What's up, Doc?]

I have found an interesting feature with Berkeley's 4.1 Bourne shell.
Valid command arguments that begin with '^' (the caret character)
evince strange behavior.  The output of such commands are first sent
to limbo, and then the shell strips the '^' from the argument and tries
to execute the argument.

Example:

            ls ^date

gives the date and nothing more.

Also:

            date ^pwd

shows the current directory and nothing more.

Try:

            fred ^any_valid_command


The shell behaves correctly when the caret is protected with
quotes.  Switching tty drivers does not solve the problem.
Is the caret an undocumented metacharacter or is this a side 
effect of Berkeley's "history" feature in the cshell?


Michael Lipczynski
mlip at nadc



More information about the Comp.unix.wizards mailing list