# Purpose of "Broken Bar" Character -- "|"

**URL:** <https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458>\
**Category:** Factual Questions\
**Created:** [March 31, 2004, 3:04am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458 "2004-03-31T03:04:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregongie](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@gregongie](https://boards.straightdope.com/u/gregongie)\
**Post date:** [March 31, 2004, 3:04am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/1 "2004-03-31T03:04:46Z")

</div>

It’s in the shift position on the backslash key, idly minding its own business, but the only time I’ve used it was as “or” in programming. Regardless, this hardly seems to warrant a whole new character. Is there a better reason why it’s there? Does it have a history?

---

<div class="post-metadata">

**Author:** ![biqu](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@biqu](https://boards.straightdope.com/u/biqu)\
**Post date:** [March 31, 2004, 3:30am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/2 "2004-03-31T03:30:54Z")

</div>

> [@gregongie](#):
>
> It’s in the shift position on the backslash key, idly minding its own business, but the only time I’ve used it was as “or” in programming. Regardless, this hardly seems to warrant a whole new character. Is there a better reason why it’s there? Does it have a history?

In [this staff report](http://www.straightdope.com/mailbag/mscrolllock.html), **Una Persson** (nee **Anthracite** ) explains:

> [@](#):
>
> The pipe key \<|\>, also known as the bar key or vertical bar, is found above the backslash key \<&gt;. … In command-line environments such as DOS, the pipe symbol can add functionality to a DOS command. The way I most frequently use it is when doing a directory listing (DIR) on a large directory with hundreds of files. …
> 
> One suspects that some oddball keys were put on the PC keyboard (or to be more precise, included in the ASCII character set, most of which found its way onto the PC keyboard) because the developers figured they’d come in handy for something. On the whole that has turned out to be the case–programmers and developers have found a use for nearly every key on the keyboard, even if that use isn’t obvious to the general computing public. … Given the pace of change in information technology, there’s a lot to be said for designing your user interface for maximum flexibility.

---

<div class="post-metadata">

**Author:** ![Cleophus](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@Cleophus](https://boards.straightdope.com/u/Cleophus)\
**Post date:** [March 31, 2004, 3:33am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/3 "2004-03-31T03:33:22Z")

</div>

> [@gregongie](#):
>
> It’s in the shift position on the backslash key, idly minding its own business, but the only time I’ve used it was as “or” in programming. Regardless, this hardly seems to warrant a whole new character. Is there a better reason why it’s there? Does it have a history?

This character is called a pipe. It is used often in command-line interfaces to direct the output of one command into another. For example, in UNIX the command “ls | more” will take the text output of the “ls” command, which shows the contents of a directory (the current one in this case), and directs it into the “more” command, which breaks input into seperate “screens”. It’s present in DOS, too. Try typing “dir | more” into a DOS command prompt.

---

<div class="post-metadata">

**Author:** ![caphis](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@caphis](https://boards.straightdope.com/u/caphis)\
**Post date:** [March 31, 2004, 3:45am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/4 "2004-03-31T03:45:19Z")

</div>

> [@Cleophus](#):
>
> This character is called a pipe. It is used often in command-line interfaces to direct the output of one command into another. For example, in UNIX the command “ls | more” will take the text output of the “ls” command, which shows the contents of a directory (the current one in this case), and directs it into the “more” command, which breaks input into seperate “screens”. It’s present in DOS, too. Try typing “dir | more” into a DOS command prompt.

Isn’t this fundamentally the same as saying dir /p?

---

<div class="post-metadata">

**Author:** ![carterba](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@carterba](https://boards.straightdope.com/u/carterba)\
**Post date:** [March 31, 2004, 3:54am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/5 "2004-03-31T03:54:48Z")

</div>

It also turns up in probability and statistics. P(A | B) is read “probability of A given B”. Sometimes you see it in set notation: A = {n | n prime} is read “A is the set of n’s such that n is prime”. In addition to the other computer-type uses people have given, I also use it in LaTeX to make tables.

---

<div class="post-metadata">

**Author:** ![Meeko](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Meeko](https://boards.straightdope.com/u/Meeko)\
**Post date:** [March 31, 2004, 4:24am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/6 "2004-03-31T04:24:56Z")

</div>

I encountered the ‘pipe’ character | back in 7th grade (96-97) durring LOGO programming. The instructor called the pipe ’ magic markers ’ and told us at that time IBM didnt have a name or a purpose for the keystroke.

---

<div class="post-metadata">

**Author:** ![Blornx](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@Blornx](https://boards.straightdope.com/u/Blornx)\
**Post date:** [March 31, 2004, 4:30am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/7 "2004-03-31T04:30:30Z")

</div>

The vertical bar entered the ASCII table in 1967. I guess your question is why, but I don’t know. Maybe it was intended as a math symbol.

Its use as a pipe operator [originated in Unix](http://en.wikipedia.org/wiki/Pipe_(computing)).

IBM looked at the ASCII table and put keys for all of the printable characters onto its PC keyboard.

---

<div class="post-metadata">

**Author:** ![SmackFu](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SmackFu](https://boards.straightdope.com/u/SmackFu)\
**Post date:** [March 31, 2004, 4:39am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/8 "2004-03-31T04:39:46Z")

</div>

> [@caphis](#):
>
> Isn’t this fundamentally the same as saying dir /p?

Yes, but this is the heart of “the unix philosophy”. Using the /p forces the dir command to know how to split output into pages. Any command that wants that needs to put in another copy of that functionality. While unix puts all that functionality in a completely separate program (“more”) that can handle pagination for any program, and so none of the programs have pagination built in.

---

<div class="post-metadata">

**Author:** ![gotpasswords](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@gotpasswords](https://boards.straightdope.com/u/gotpasswords)\
**Post date:** [March 31, 2004, 7:04am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/9 "2004-03-31T07:04:30Z")

</div>

> [@caphis](#):
>
> Isn’t this fundamentally the same as saying dir /p?

Yes it is, but, as **SmackFu** says, it’s not the point. Aside from the “/p” requiring the dir command to know how to parse screenfuls of text, what if you want to do something else such as take a huge directory listing and run it through a hypothetical filter to strain out any obscenities, then print it using another hypothetical utility that will print the listing in three columns rather than one long one? Just type “dir | nopottymouth | print3columns” Being able to pipe output from one command to another can be extremely useful, and each command only has to know its own thing.

Another hypothetical, again with dir: Today, with what’s essentially DOS 7, you can do things that dir in DOS 3.2 only dreamed of, but back then, you’d have to pipe the dir output to something else simply because dir didn’t have that function at the time.

---

<div class="post-metadata">

**Author:** ![netverse](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@netverse](https://boards.straightdope.com/u/netverse)\
**Post date:** [October 25, 2015, 2:16am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/10 "2015-10-25T02:16:53Z")

</div>

> [@gregongie](#):
>
> It’s in the shift position on the backslash key, idly minding its own business, but the only time I’ve used it was as “or” in programming. Regardless, this hardly seems to warrant a whole new character. Is there a better reason why it’s there? Does it have a history?

About the Vertical Bar being called the Vertical Broken bar.

The Vertical bar or Vertical line is |  
The Vertical broken bar or Vertical Broken line is ¦ (alt 0166)

The Vertical Bar is used in C++ programming, MSDOS, math and physics. Although the Vertical Bar sometimes is depicted as a Vertical Broken Bar by some programs or operating systems, depending what you are using, the Vertical Broken Bar is not used in mathematical equations.

The Solid Vertical Bar has been used as a separator on a web-page menu, used as a NAND operator in logical equations, used as a PIPE in MSDOS, and also used in C++ as an Boolean operator.

The Vertical Broken Bar can be used a separator. The Solid Vertical bar is not allowed in Windows as part of file or folder name. The Broken Vertical bar is allowed as part of a file or folder name inside a Zip Folder.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [October 25, 2015, 2:58am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/11 "2015-10-25T02:58:07Z")

</div>

Doesn’t this character also represent zombies? It’s a stick figure with the limbs and head fallen off…

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [October 25, 2015, 2:59am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/12 "2015-10-25T02:59:36Z")

</div>

Welcome to the Dope, 'verse! Looks like you found an old thread to bring back from the dead!

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 25, 2015, 8:26am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/13 "2015-10-25T08:26:32Z")

</div>

> [@Blornx](#):
>
> The vertical bar entered the ASCII table in 1967. I guess your question is why, but I don’t know. Maybe it was intended as a math symbol.

This thread has rested in peace for 11+ years only to be disturbed in its grave now, but the OP’s question _still_ isn’t answered. **Blornx** tells us that the character is relatively ancient. I’m pretty sure this goes back to the days before Unix used it as a pipe symbol; and in any case, I don’t believe it was added with that in mind (AFAIK).

The IBM PC ASCII character set and keyboard go back to a time well before PC existed. These characters (and the keyboard layout, mostly) go back to the days of noisy clunky Teletype machines. Those were used for telecommunications before anyone thought to use them for computer input/output. That stereotype “rat-a-tat-tat” rhythm and percussion (or faux percussion) that you hear so often at the beginning to TV newscasts originated as the sound of a newsroom full of clattering Teletypes.

A few of the standard characters got changed over the years. What we now see as a caret ^ character was originally an up-pointing arrow. What we now see as the underscore \_ character was originally a left-pointing arrow. That’s how they were printed on Teletypes older than about the early 1970’s or so.

But I can’t answer the original question either. I don’t know what the original envisioned purpose of the vertical bar was, nor why it was graphically shown as a broken bar. That’s still a mystery to me.

---

<div class="post-metadata">

**Author:** ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)\
**Post date:** [October 25, 2015, 9:44am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/14 "2015-10-25T09:44:34Z")

</div>

The vertical bar character was introduced with the [IBM Model 29 keypunch](http://homepage.cs.uiowa.edu/~jones/cards/codes.html) in 1964. Earlier IBM punchcards didn’t contain such a character encoding so we have a fairly defined date of introduction.

As to why, I believe it was to allow for the columular representation of data. Note the underscore character is introduced at the same time, allowing for primitive grid rendering. From there, it was incorporated into the EBCDIC encoding, then the ASCII encoding and then onto the standard 101-key keyboard layout.

---

<div class="post-metadata">

**Author:** ![amanset](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@amanset](https://boards.straightdope.com/u/amanset)\
**Post date:** [October 25, 2015, 10:29am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/15 "2015-10-25T10:29:09Z")

</div>

> [@SmackFu](#):
>
> Yes, but this is the heart of “the unix philosophy”. Using the /p forces the dir command to know how to split output into pages. Any command that wants that needs to put in another copy of that functionality. While unix puts all that functionality in a completely separate program (“more”) that can handle pagination for any program, and so none of the programs have pagination built in.

Also the pipe character is often used several times on one line. For example

```auto

grep foo <filename> | grep bar | less

```

Will first find every line in the file \<filename\> with foo in it, then find all of those lines that have bar in it and finally redirect the output to the text viewer less.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [October 25, 2015, 11:55am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/16 "2015-10-25T11:55:59Z")

</div>

Wikipedia has a nice article about “Vertical bar”.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [October 25, 2015, 7:14pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/17 "2015-10-25T19:14:49Z")

</div>

An extremely detailed account of the development of ascii from earlier codes may be found here, albeit in an extremely annoying color scheme:

[http://worldpowersystems.com/J/codes/](http://worldpowersystems.com/J/codes/)

The vertical line was one of the “National Graphics” characters added in ASCII 67 adopted from ECMA-6. To find out who lobbied for various characters, and for what reasons, you would have to dig up the detailed arguments from those meetings. Whatever the reason, it probably wasn’t for potential programming use, but for some typographical or business use or perceived importance by some national group.

---

<div class="post-metadata">

**Author:** ![Ranger\_Jeff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ranger_jeff/32/2065_2.png) [@Ranger\_Jeff](https://boards.straightdope.com/u/Ranger_Jeff)\
**Post date:** [October 25, 2015, 7:19pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/18 "2015-10-25T19:19:46Z")

</div>

I use it for tallies, where [del] |||| [/ del] I = [del]||||[/del] | = 6.

---

<div class="post-metadata">

**Author:** ![usedtobe](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@usedtobe](https://boards.straightdope.com/u/usedtobe)\
**Post date:** [October 25, 2015, 7:23pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/19 "2015-10-25T19:23:10Z")

</div>

It was originally the logic symbol for ‘OR’, as in:

If A | B

means

If A OR B

(and, if you go back to thew IBM 3279 keyboard, that squiggle you got with Shift + 6 was a logical ‘NOT’ operand)

See [Here](http://www.rapidtables.com/math/symbols/Logic_Symbols.htm)

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [October 25, 2015, 8:08pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/20 "2015-10-25T20:08:06Z")

</div>

I use them/receive them as delimiters.

[Next page](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458.md?page=2)
