All Topics  
Vertical bar

 

   Email Print
   Bookmark   Link






 

Vertical bar



 
 
Note: "broken bar" and the glyph "¦" redirect here.
The vertical bar (|) has various names including the pipe (by the Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 community), verti-bar, vbar, stick, vertical line, vertical slash, think colon, or divider line by others. It has various usages in mathematics, where it can be used to represent absolute value
Absolute value

In mathematics, the absolute value of a real number is its numerical value without regard to its Negative and non-negative numbers. So, for example, 3 is the absolute value of both 3 and -3....
, among others; computing and programming; and general typography, as a divider not unlike the interpunct
Interpunct

An interpunct is a small dot used for interword separation in ancient Latin alphabet, being perhaps the first consistent visual representation of word boundaries in written language....
.

The broken bar (¦) is a separate character.

The typical keyboard layout
Keyboard layout

A keyboard layout is any specific mechanical, visual, or functional arrangement of the keys, legends, or key?meaning associations of a Computer keyboard, typewriter, or other alphanumeric keyboard keyboard....
 used in the United Kingdom
United Kingdom

The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom , the UK or Britain,is a sovereign state located off the northwestern coast of continental Europe....
 features separate keys for vertical bar and broken bar; however, typically on Windows PCs the vertical bar key produces a broken-bar symbol and vice versa.






Discussion
Ask a question about 'Vertical bar'
Start a new discussion about 'Vertical bar'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Note: "broken bar" and the glyph "¦" redirect here.
The vertical bar (|) has various names including the pipe (by the Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 community), verti-bar, vbar, stick, vertical line, vertical slash, think colon, or divider line by others. It has various usages in mathematics, where it can be used to represent absolute value
Absolute value

In mathematics, the absolute value of a real number is its numerical value without regard to its Negative and non-negative numbers. So, for example, 3 is the absolute value of both 3 and -3....
, among others; computing and programming; and general typography, as a divider not unlike the interpunct
Interpunct

An interpunct is a small dot used for interword separation in ancient Latin alphabet, being perhaps the first consistent visual representation of word boundaries in written language....
.

The broken bar (¦) is a separate character.

The typical keyboard layout
Keyboard layout

A keyboard layout is any specific mechanical, visual, or functional arrangement of the keys, legends, or key?meaning associations of a Computer keyboard, typewriter, or other alphanumeric keyboard keyboard....
 used in the United Kingdom
United Kingdom

The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom , the UK or Britain,is a sovereign state located off the northwestern coast of continental Europe....
 features separate keys for vertical bar and broken bar; however, typically on Windows PCs the vertical bar key produces a broken-bar symbol and vice versa. North American keyboards typically have a key bearing a broken-bar symbol, which produces a vertical bar.

Etymology

The name pipe for the character "|" was a natural consequence of its usage in Unix shells, where it is used to notate the usage of the I/O pipeline
Pipeline (Unix)

In Unix-like computer operating systems, a pipeline is the original pipeline : a set of process es chained by their standard streams, so that the output of each process feeds directly as input of the next one....
 construct.

Usage


Mathematics

The vertical bar is used as a mathematical symbol
Table of mathematical symbols

This is a listing of common symbols found within all branches of the science of mathematics....
 in
  • absolute value
    Absolute value

    In mathematics, the absolute value of a real number is its numerical value without regard to its Negative and non-negative numbers. So, for example, 3 is the absolute value of both 3 and -3....
    : , read "the absolute value of x
    X

    X is the twenty-fourth letter in the modern Latin alphabet. Its name in English language is spelled ex , plural exes .History...
    "
    .
  • norm
    Norm (mathematics)

    In linear algebra, functional analysis and related areas of mathematics, a norm is a function that assigns a strictly positive length or size to all vectors in a vector space, other than the zero vector....
    s: , read "the norm of x sub one, x sub two"; though Unicode also provides a special double vertical line symbol U+2016: x
  • set-builder notation
    Set-builder notation

    In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a mathematical notation for describing a Set by stating the properties that its members must satisfy....
    : , read "the set of x such that x is less than two". Often sets are written with a colon
    Colon (punctuation)

    The colon is a punctuation mark, consisting of two equally sized dots centered on the same vertical line....
     ':' rather than a vertical bar.
  • cardinality
    Cardinality

    In mathematics, the cardinality of a set is a measure of the "number of Element of the set". For example, the set A = contains 3 elements, and therefore A has a cardinality of 3....
    : , read "the cardinality of the set S".
  • conditional probability
    Conditional probability

    Conditional probability is the probability of some event A, given the occurrence of some other event B. Conditional probability is written P, and is read "the probability of A, given B"....
    : , read "the probability
    Probability

    Probability, or wikt:chance, is a way of expressing knowledge or belief that an Event will occur or has occurred. In mathematics the concept has been given an exact meaning in probability theory, that is used extensively in such areas of study as mathematics, statistics, finance, gambling, science, and philosophy to draw conclusions about t...
     of X given Y"
    .
  • divisibility: , read "a divides b".
  • the Sheffer stroke
    Sheffer stroke

    The Sheffer stroke, written "|" or "?", in the subject matter of boolean functions or propositional calculus, denotes a logical operation that is equivalent to the logical negation of the logical conjunction operation, expressed in ordinary language as "not both"....
     in logic
    Logic

    Logic is the study of the principles of valid demonstration and inference. Logic is a branch of philosophy, a part of the classical Trivium . The word derives from Greek language ?????? , fem....
    : , read "a nand b".
  • evaluate: , read "a plus 3 evaluated for when a equals 4", or .


Physics

The vertical bar is used in bra-ket notation
Bra-ket notation

Bra-ket notation is a standard notation for describing quantum states in the theory of quantum mechanics composed of bracket and vertical bars....
 in quantum physics. Examples:
  • — The quantum mechanical state "".
  • — The dual state
    Dual space

    In mathematics, any vector space, V, has a corresponding dual vector space consisting of all linear functionals on V. Dual vector spaces defined on finite-dimensional vector spaces can be used for defining tensors which are studied in tensor algebra....
     corresponding to the state above.
  • — The inner product of states and .


Computing


Backus-Naur form
In Backus-Naur form the expression consists of sequences of symbols and/or sequences separated by '|', indicating a choice, the whole being a possible substitution for the symbol on the left.
= |


Unix
A pipe is an inter-process communication
Inter-process communication

Inter-Process Communication is a set of techniques for the exchange of data among multiple thread in one or more Process . Processes may be running on one or more computers connected by a computer network....
 mechanism originating in Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 which allows the output (standard out and, optionally, standard error) of one process to be used as input (standard in) to another. In this way, a series of commands can be "piped" together. This provides skilled practitioners the ability to quickly perform complex processing on the command line or as part of a UNIX shell script ("batch file"). In most Unix shell
Unix shell

A Unix shell is a command-line interpreter and script host that provides a traditional user interface for the Unix operating system and for Unix-like systems....
s (command interpreters), this is represented by the vertical bar character.

e.g. Piped UNIX commands: egrep -i 'blair' filename.log | more

Traditionally, the piping capability in UNIX is provided by the "fork and exec" feature of UNIX operating systems. The UNIX shell forks off a copy of itself for each command, connecting the output of each to the input of the next. When processing large amounts of data, all processes in the pipeline will typically be active at the same time (within the limits of the hardware used). Using the UNIX pipe mechanism, a user is able to quickly and easily build a custom program composed of a (theoretically) unlimited number of small, specialized programs.

DOS/Windows
This feature is found in later versions of DOS
DOS

DOS, short for "Disk Operating System", is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions Windows 95, Windows 98, and Windows Me....
 and Microsoft Windows.

e.g. Piped DOS command: type *.txt | more

The role of the character as a DOS operator can result in problems for command line applications such as the SQL Server BCP utility (short for "Bulk Copy Program"), where the user may wish to pass the "|" character to the application as a literal. (For example, when trying to bulk copy a file that uses the | character as a field separator.) In these cases, the ^ character can be used to escape the pipe. For example:

bcp tblImport in ImportFile.txt -c -t^|

Regular expression
In regular expression
Regular expression

In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters....
 syntax, the pipe indicates alternation (i.e. logical OR). For example: the Unix command grep
Grep

grep is a command line interface text search utility originally written for Unix. The name is taken from the first letters in global / regular expression / print, a series of instructions for the ed text editor....
 -E 'foo|bar'
matches lines containing 'foo' or 'bar'.

Disjunction
In many programming languages, it is used to designate the logic operation or
Logical disjunction

File:ORGate2.pngIn logic and mathematics, or, also known as logical disjunction or inclusive disjunction is a logical operator that results in true whenever one or more of its operands are true....
, either bitwise
Bitwise operation

In computer programming, a bitwise operation operates on one or two bit patterns or Binary numeral system at the level of their individual bits....
 or or logical
Boolean datatype

In computer science, the Boolean algebra datatype, sometimes called the logical datatype, is a primitive datatype having one of two values: Truth value and false....
 or.

Specifically, in C
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and other languages following C syntax conventions, such as C++
C++

C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
, Perl
Perl

In computer programming, Perl is a high-level programming language, List of programming languages by category, Interpreter , dynamic programming language....
, Java
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
 and C#, (a | b) denotes a bitwise or
Bitwise operation

In computer programming, a bitwise operation operates on one or two bit patterns or Binary numeral system at the level of their individual bits....
; whilst a double vertical bar (a || b) denotes a (short-circuited
Minimal evaluation

Short-circuit evaluation or minimal evaluation denotes the semantics of some boolean operators in some programming languages in which the second argument is only executed or evaluated if the first argument does not suffice to determine the value of the expression: when the first argument of and evaluates to false
) logical or
Logical disjunction

File:ORGate2.pngIn logic and mathematics, or, also known as logical disjunction or inclusive disjunction is a logical operator that results in true whenever one or more of its operands are true....
.

Concatenation
In PL/I
PL/I

PL/I is an imperative programming computer programming programming language designed for scientific, engineering, and business applications. It is one of the most feature-rich programming languages and one of the very first in the highly-feature-rich category....
 and certain dialects
Programming language dialect

A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature. With languages such as Scheme and Forth , standards may be considered insufficient, inadequate or even illegitimate by implementors, so often they will deviate from the standard, making a new dialect....
 of SQL
SQL

SQL is a database computer language designed for the retrieval and management of data in relational database management systems , database schema creation and modification, and database object access control management....
, the operator "||" denotes string
String (computer science)

In computer programming and some branches of mathematics, a string is an ordered sequence of symbols. These symbols are chosen from a predetermined set or alphabet....
 concatenation
Concatenation

In computer programming, string concatenation is the operation of joining two character string end to end. For example, the strings "snow" and "ball" may be concatenated to give "snowball"....
.

Delimiter
Although not as common as commas or tabs, the vertical bar can be used as a delimiter
Delimiter

A delimiter is a sequence of one or more character s used to specify the boundary between separate, independent regions in plain text or other data stream....
 in a flat file. An example of a pipe-delimited standard data format is LEDES 1998B.

Concurrency operator
In calculi of communicating processes (like Pi-calculus
Pi-calculus

In theoretical computer science, the -calculus is a process calculus originally developed by Robin Milner, Joachim Parrow and David Walker as a continuation of work on the process calculus CCS ....
), the vertical bar is used to indicate that processes execute in parallel.

List comprehensions

The vertical bar is used for list comprehensions in some functional languages, e. g. Haskell
Haskell (programming language)

Haskell is a standardized, purely functional programming language with non-strict programming language, named after logician Haskell Curry. The goals of the language are described as:...
 and Erlang. Compare set-builder notation.

Wikipedia

Phonetics and orthography

In the Khoisan languages
Khoisan languages

The Khoisan languages are the click languages of Africa which do not belong to other language families. They include languages indigenous to southern and eastern Africa, though some such, as the Khoi languages, appear to have moved to their current locations not long before the Bantu expansion....
 and the International Phonetic Alphabet
International Phonetic Alphabet

The International Phonetic Alphabet "The acronym 'IPA' strictly refers [...] to the 'International Phonetic Association'. But it is now such a common practice to use the acronym also to refer to the alphabet itself that resistance seems pedantic....
, the vertical bar is used to write the dental click
Dental click

The dental clicks are a family of click consonants found, as constituents of words, only in Africa and in the Damin ritual jargon of Australia....
 . A double vertical bar is used to write the alveolar lateral click . Since these are technically letters, they have their own Unicode
Unicode

Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems....
 code points in the Latin Extended-B range: U+01C0 for the single bar and U+01C1 for the double bar. Longer single and double vertical bars are used to mark prosodic
Prosody

Prosody may refer to:* Prosody , the study of rhythm, intonation, stress, and related attributes in speech* Prosody , the study of poetic meter...
 boundaries in the IPA.

Encoding

Despite the vertical bar being an accessible keystroke on typical North American and UK keyboards, there are cases where Web designers, Wiki editors, computer programmers, and others need to encode the vertical bar — usually because the vertical bar is a special symbol in their source code and yet a literal vertical bar needs to be displayed to the end user.

Set forth in 1963, American Standard Code for Information Interchange (ASCII-1963), one of the first widely used character maps, only had 69 display ("printable") characters; A–Z and 0–9 account for 36 of those characters. Vertical bar ("|") is the ASCII-1963 character at position 124 (decimal). Broken bar ("¦") is not part of the ASCII character set (any version) but a separate character that appeared (along with vertical bar) first in the EBCDIC family of character sets, and was copied from there into ISO 8859-1 and Unicode.

The typical computer keyboard used in the United Kingdom features separate keys for "vertical bar" and "broken bar", even though "broken bar" has hardly any practical application. Some keyboard drivers map the broken bar key to the vertical bar, and the vertical bar key, shared with the the grave accent (`), generates the broken bar when pressed in combination with AltGr.

In common character maps

Unicode
Unicode

Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems....
hexadecimal (base-16): 007C

UTF-8
UTF-8

UTF-8 is a Variable-width encoding character encoding for Unicode. It is able to represent any character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is backward compatibility with ASCII....
hexadecimal: 7C

ASCII
ASCII

American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words....
decimal (base-10): 124, or hexadecimal: 7C

ISO/IEC 8859-1
ISO/IEC 8859-1

ISO 8859-1, more formally cited as ISO/IEC 8859-1 is part 1 of ISO 8859, a standard character encoding of the Latin alphabet. It is less formally referred to as Latin-1....
hexadecimal: 7C

Shift-JIS
Shift-JIS

Shift JIS is a character encoding for the Japanese language originally developed by a Japanese company called ASCII in conjunction with Microsoft and standardized as JIS X 0208 Appendix 1....
 Men-Ku-Ten 1-01-35

EBCDIC
EBCDIC

Extended Binary Coded Decimal Interchange Code is an 8-bit character encoding used on IBM mainframe operating systems such as z/OS, OS/390, VM and VSE , as well as IBM midrange computer operating systems such as OS/400 and i5/OS ....
 (CCSID 500 variant) hexadecimal: BB