What do you call this | character?

Pipe is what it is called only in the context of shell programming. In that case it is the name of the operator, not the character. As noted it can also mean “or”. It can also be used as a delimiter, or a number of other things. The character itself is usually called “vertical bar.” (Similarly the hyphen character can mean “unary minus” but that’s not what you call the character.)

Not a programmer (unless you count MARC records) and it’s been called a “bar” or “vertical bar” in three different textbooks (library science) referencing how it is used.

I mainly called it “that damn annoying character my prof wouldn’t let me substitute ! for in our class projects.”

I’ve considered “pipe” to be a valid name of the character. It is true that it represents a piping operator in shell scripting (UNIX and DOS, and probably more), but then sometimes a use of a character becomes its name, like “@” being called “at” or “%” being called “percent”. “%” can also be a wildcard in some contexts.

In C, it means “OR”. A single “|” means bitwise or, and a double (“||”) means boolean OR.

C++, Java, C#, and/or languages have inherited this to some extent.

Quoth don’t ask:

I know of no context where these two characters have an equivalent meaning. The bash shell appears to not ascribe any significance at all to a !, and many environments where | means “or”, ! means “not”. I don’t doubt that there’s some environment where they do have the same, or closely similar, meanings, but I don’t have any idea what that environment would be.

And the original purpose of the character was just to be a vertical line, to be used in drawing screen graphics. But programmers hate to let a perfectly good character sit idle, so other uses were found for it.

Applause.

Not to quibble (and yes you did write “probably earlier”) but to event hint at a DOS origin for pipe is zanier than the Kenyan birth theory. :smack:

:)! The best I’ve heard/seen on GQ.

It either means “on” or “off” on some early IBM PCs, a famous example of one of the worst icons ever devised.

I still don’t know which state it means.

It still means that on all of the computer power supply switches that I see. |/O

I know he claims to be from UNIX but we don’t really know until | shows us his long-form birth certificate.

Huh. The character on the keyboard key is two distinct lines, upright, one above the other. But on this board, it comes out as a single solid line: |, taller than I, 1, l.

Paired with a circular icon, these symbols were intended as universal symbols for 1 and 0, representing the binary state of a power switch: 1 for on (electricity flowing) and 0 for off (electricity not flowing).

It’s ridiculously obvious for a computer power switch.

Thing is, most modern computers have done away with actual power switches and now have power buttons, which are just relays* which activate circuitry on the motherboard. Since all they do now is toggle the on/off state of the computer, they have switched to a combined symbol.

*I’m probably not using that term in the correct electrical engineering sense.

I have never seen it used for the Boolean OR. It is the Scheffer stroke (which is the Boolean NOR ). Scheffer discovered that it this one operation (and a number of equations) suffices to define a Boolean algebra. You can also use Boolean NAND. Yes, it is called pipe in CS, but I call it stroke.

I’ve hit the | key many tens of thousands of times writing C code, and almost as many times for piping in a Unix shell (as well as some thousands of times just in ‘egrep’), yet AFAIR I never gave it a name nor thought it needed one! I might have said “No, pipe it through tee” once or twice when looking over someone’s shoulder, but I can’t recall ever calling the | anything special, except perhaps “the vertical line.”

BTW, last time I looked (which was when Reagan was still President), the Microsoft command
floog | blah
was implemented as
floog > tempfile; blah < tempfile
which prevents many of my uses for piping: when the complete tempfile would take too much time or space to fully create.

That Microsoft’s “pipe”, which appeared some years after MS-Dos 1.0 and more than a decade after Unix’ pipe, was so incapable is one of many many many reasons why I think anyone pretending to compare Mr. Gates’ money-making toy to an Operating System is (check forum) mentally challenged.

I just braingasmed. Thank you.

| is used for boolean OR as far back as BCPL (and probably farther) and has remained such in every derived programming language since, including B, C, C++, C#, ObjC, D, Java, Perl, PHP and JavaScript, to name a few. (Those that follow the C convention will use | for bitwise and || for logical.)

I don’t have a position one way or the other on the value of DOS but I just want to point out that the shell language is only one aspect of an OS.

In my formative years as a programmer I recall this character being called “stile” (like the ladder you use to cross a fence - not “style” like a fashion statement) - though the people I worked with were also heavily influenced by APL.

APL had a concept of overstriking two characters to form a compound character - and some of these compound characters were basically just named for the two characters (so a circle overstruck with a stile was circle-stile).

These compound characters exist in the unicode character set and still have the stile name associated with them.

Let’s avoid confusion here. My comment about DOS’s pipe had absolutely nothing to do with any command language or its syntax. It is their implementation of pipe (letting writer run to completion before starting reader) which boggles one’s imagination. Especially considering that Linux was built from scratch by a few hobbyists, while Microsoft’s budget is larger than that of some countries.

Well, DOS is a single tasking OS. UNIX/Linux is inherently a multitasking OS.