scook
It seemed like a Unix thing. I first heard it after returning to the Computer Science department at a university. The 80s were PICK, DOS and Netware for me.
My earliest memory of the terms is with the DEC PDP 11 around 78/79. Could've been UNIX or CP/M ... details from that era are foggy
I just checked my first edition K&R and there is no mention of the terms, so it's safe to say they didn't gain popularity via 'C'. I remember leaving the PDP world on the west coast, landing in a Honeywell DPS6 shop ... no UNIX, but 'bang' and 'splat' were common there too.
I have no recollection of 'shriek' ...
From
https://en.wikipedia.org/wiki/Exclamation_mark (sorry, WIKI is easy)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Computers
In
computing, the exclamation mark (sometimes called a "bang")
[23] corresponds to
ASCII character 33 (21 in
hexadecimal). It is therefore found in Unicode at U+0021 ! exclamation mark. The inverted exclamation mark is found in
ISO-8859-
1,
9 and
15 at position 161 (A1
HEX) and in Unicode at U+00A1 ¡ INVERTED exclamation mark.
The name given to "!" by programmers varies according to their background. In the UK the term
pling was popular in the earlier days of computing, whilst in the United States the term
shriek was used. It is claimed that these word usages were invented in the US and
shriek is from Stanford or MIT; however,
shriek for the ! sign is found in the
Oxford English Dictionary dating from the 1860s.
Several computer languages use "!" for various meanings, most importantly for logical negation; e.g. A
!= B means "A is
not equal to B", and !A means "the logical
negation of A" (also called "not A"). In the UK,
BBC BASIC used pling as an indirection operator, equivalent to
PEEK and POKE of four
bytes at once.
[24]BCPL, the precursor of
C, used "!" for pointer and array indirection: "!P" was equivalent to C's "*P" and "P!3" is equivalent to "P[3]" in C.
Plings are also used in
Acorn RISC OS to denote an
application directory: a folder that when double clicked executes a program file inside called
!Run. Other files in the appfolder generally contain resources the application needs to run. The appfolder can be viewed as a normal folder by
double-clicking with the
shift key held down. In addition, other special resource files such as
!Boot (executed the first time the application containing it comes into view of the filer),
!Sprites (an icon file containing icon definitions loaded if
!Boot cannot be found) and
!Help (a text, HTML or other executable file listed in the filer menu for the application) also start with a pling.
Early
e-mail systems also used the exclamation mark as a separator character between hostnames for routing information, usually referred to as "
bang path" notation.
In the
IRC protocol, a user's nickname and
ident are separated by an exclamation mark in the
hostmask assigned to him or her by the server.
In the
Geek Code version 3, "!" is used before a letter to denote that the geek refuses to participate in the topic at hand. In some cases, it has an alternate meaning, such as
G! denoting a geek of no qualifications,
!d denoting not wearing any clothes,
P! denoting not being allowed to use Perl, and so on. They all share some negative connotations however.
When computer programs display messages that alert the user, an exclamation mark may be shown alongside it to indicate that the message is important and should be read. This often happens when an error is made, or to obtain user consent for hazardous operations such as deleting data.
In
UNIX scripting (typically for
UNIX shell or
Perl), "!" is usually used after a "#" in the first line of a script, the
interpreter directive, to tell the OS what program to use to run the script. The "#!" is usually called a "hash-bang" or
shebang. A similar convention for
PostScript files calls for the first line to begin with "%!", called "percent-bang".
[25]An exclamation mark starts
history expansions in many
Unix shells such as
bash and
tcsh where !! executes the previous command and !* refers to all of the arguments from the previous command.
In the
ML programming language (including
Standard ML and
OCaml), "!" is the operator to get the value out of a "reference" data structure.
In the
Haskell programming language, "!" is used to express strictness.
In the
Scheme and
Ruby programming languages, "!" is conventionally the suffix for functions and special forms that mutate their input.
In the
Swift programming language, a type followed by "!" denotes an "implicitly unwrapped optional", an
option type where the compiler does not enforce safe unwrapping. The "!" operator "force unwraps" an option type, causing an error if it is nil.
In the
Perl 6 programming language, the "!"
twigil is used to access private attributes or methods in a class (like class Person { has $!name; } or self!private-method;).
[26]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!