Live data from Hacker News

50th Anniversary Of '|'

news.ycombinator.com

1–7 of 7 posts

50th Anniversary Of '|'

#1
Apparently today is the 50th anniversary of using '|' for connecting shell pipelines. It was introduced in v4 of the Thompson shell, whose manpage is dated 1973-04-18 [1]. Previously the syntax for 'a | b' was `a >b>` [2].

[1]: https://www.in-ulm.de/~mascheck/bourne/v4/

[2]: https://www.in-ulm.de/~mascheck/bourne/v3/

Re: 50th Anniversary Of '|'

#5
Interesting that both | and ^ were supported, but | took over and ^ is still unused by the shell.

I wonder if ^ was deprecated because of the likelihood it'd be commonly used at the start of a regexp for grep, but | used to provide alternatives in a regexp was probably much less frequently used and so having to quote is was less of a problem than for ^.

Also interesting that the v3 format had both input and output filters, which is just semantic repositioning of the commands.

Re: 50th Anniversary Of '|'

#6
post #5

Interesting that both | and ^ were supported, but | took over and ^ is still unused by the shell. I wonder if ^ was deprecated because of the likelihood it'd be commonly used at the start of a regexp for grep, but | used to provide alternatives in a regexp was probably much less frequently used and so having to quote is was less of a problem than for ^. Also interesting that the v3 format had both input and output fi…

The ' ^ ' should be used going forward by CLI AI wrappers to mean "use the above and then | to the following"

So if you prompt, you can just "^ | table" to say "Now use the above and show me in a table." ; or just " ^ table " should suffice, ideally.

Re: 50th Anniversary Of '|'

#7
post #6
post #5

Interesting that both | and ^ were supported, but | took over and ^ is still unused by the shell. I wonder if ^ was deprecated because of the likelihood it'd be commonly used at the start of a regexp for grep, but | used to provide alternatives in a regexp was probably much less frequently used and so having to quote is was less of a problem than for ^. Also interesting that the v3 format had both input and output fi…

The ' ^ ' should be used going forward by CLI AI wrappers to mean "use the above and then | to the following" So if you prompt, you can just "^ | table" to say "Now use the above and show me in a table." ; or just " ^ table " should suffice, ideally.

You could try

!! | some_command

Should theoretically work as youre describing in bash today!