<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
a	O
one-liner	B-Language
program	I-Language
originally	O
was	O
textual	O
input	O
to	O
the	O
command-line	B-Application
of	O
an	O
operating	B-Operating_System
system	I-Operating_System
shell	I-Operating_System
that	O
performed	O
some	O
function	O
in	O
just	O
one	O
line	O
of	O
input	O
.	O
</s>
<s>
an	O
expression	O
written	O
in	O
the	O
language	O
of	O
the	O
shell	B-Operating_System
;	O
</s>
<s>
the	O
invocation	O
of	O
an	O
interpreter	B-Application
together	O
with	O
program	O
source	O
for	O
the	O
interpreter	B-Application
to	O
run	O
;	O
</s>
<s>
the	O
invocation	O
of	O
a	O
compiler	B-Language
together	O
with	O
source	O
to	O
compile	B-Language
and	O
instructions	O
for	O
executing	B-General_Concept
the	O
compiled	B-Language
program	O
.	O
</s>
<s>
Certain	O
dynamic	B-Language
languages	I-Language
for	O
scripting	B-Language
,	O
such	O
as	O
AWK	B-Application
,	O
sed	B-Application
,	O
and	O
Perl	B-Language
,	O
have	O
traditionally	O
been	O
adept	O
at	O
expressing	O
one-liners	O
.	O
</s>
<s>
Shell	B-Operating_System
interpreters	B-Application
such	O
as	O
Unix	B-Application
shells	I-Application
or	O
Windows	B-Application
PowerShell	I-Application
allow	O
for	O
the	O
construction	O
of	O
powerful	O
one-liners	O
.	O
</s>
<s>
The	O
concept	O
of	O
a	O
one-liner	B-Language
program	I-Language
has	O
been	O
known	O
since	O
the	O
1960s	O
with	O
the	O
release	O
of	O
the	O
APL	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
With	O
its	O
terse	O
syntax	O
and	O
powerful	O
mathematical	O
operators	O
,	O
APL	B-Language
allowed	O
useful	O
programs	O
to	O
be	O
represented	O
in	O
a	O
few	O
symbols	O
.	O
</s>
<s>
Some	O
magazines	O
devoted	O
regular	O
columns	O
solely	O
to	O
impressive	O
short	O
and	O
one-line	B-Language
programs	I-Language
.	O
</s>
<s>
The	O
word	O
One-liner	O
also	O
has	O
two	O
references	O
in	O
the	O
index	O
of	O
the	O
book	O
The	O
AWK	B-Application
Programming	I-Application
Language	I-Application
(	O
the	O
book	O
is	O
often	O
referred	O
to	O
by	O
the	O
abbreviation	O
TAPL	O
)	O
.	O
</s>
<s>
It	O
explains	O
the	O
programming	O
language	O
AWK	B-Application
,	O
which	O
is	O
part	O
of	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
.	O
</s>
<s>
The	O
authors	O
explain	O
the	O
birth	O
of	O
the	O
one-liner	O
paradigm	O
with	O
their	O
daily	O
work	O
on	O
early	O
Unix	B-Application
machines	O
:	O
</s>
<s>
Notice	O
that	O
this	O
original	O
definition	O
of	O
a	O
one-liner	O
implies	O
immediate	O
execution	O
of	O
the	O
program	O
without	O
any	O
compilation	B-Language
.	O
</s>
<s>
So	O
,	O
in	O
a	O
strict	O
sense	O
,	O
only	O
source	O
code	O
for	O
interpreted	B-Application
languages	I-Application
qualifies	O
as	O
a	O
one-liner	O
.	O
</s>
<s>
But	O
this	O
strict	O
understanding	O
of	O
a	O
one-liner	O
was	O
broadened	O
in	O
1985	O
when	O
the	O
IOCCC	O
introduced	O
the	O
category	O
of	O
Best	O
One	O
Liner	O
for	O
C	B-Language
,	O
which	O
is	O
a	O
compiled	B-Language
language	O
.	O
</s>
<s>
The	O
following	O
example	O
is	O
a	O
C	B-Language
program	I-Language
(	O
a	O
winning	O
entry	O
in	O
the	O
"	O
Best	O
one-liner	O
"	O
category	O
of	O
the	O
IOCCC	O
)	O
.	O
</s>
<s>
This	O
one-liner	B-Language
program	I-Language
is	O
a	O
glob	O
pattern	O
matcher	O
.	O
</s>
<s>
meaning	O
exactly	O
one	O
character	O
,	O
just	O
like	O
most	O
Unix	B-Application
shells	I-Application
.	O
</s>
<s>
The	O
exit	O
status	O
is	O
0	O
(	O
shell	B-Operating_System
true	O
)	O
when	O
the	O
pattern	O
matches	O
,	O
1	O
otherwise	O
.	O
</s>
<s>
Print	O
the	O
total	O
number	O
of	O
input	O
lines	O
(	O
like	O
wc	B-Application
-l	I-Application
)	O
:	O
</s>
<s>
Here	O
are	O
examples	O
in	O
J	B-Language
:	O
</s>
<s>
Quicksort	B-Algorithm
:	O
</s>
<s>
Here	O
are	O
examples	O
in	O
the	O
Perl	B-Language
programming	I-Language
language	I-Language
:	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
Perl	B-Language
one-liner	O
will	O
reverse	O
all	O
the	O
bytes	O
in	O
a	O
file	O
:	O
</s>
<s>
While	O
most	O
Perl	B-Language
one-liners	O
are	O
imperative	O
,	O
Perl	B-Language
's	O
support	O
for	O
anonymous	O
functions	O
,	O
closures	O
,	O
map	O
,	O
filter	O
(	O
grep	O
)	O
and	O
fold	O
(	O
List::Util::reduce	O
)	O
allows	O
the	O
creation	O
of	O
'	O
functional	O
 '	O
one-liners	O
.	O
</s>
<s>
It	O
can	O
be	O
used	O
on	O
the	O
command	B-Application
line	I-Application
,	O
like	O
this	O
:	O
</s>
<s>
The	O
following	O
Haskell	B-Language
program	O
is	O
a	O
one-liner	O
:	O
it	O
sorts	O
its	O
input	O
lines	O
ASCIIbetically	O
.	O
</s>
<s>
Usable	O
on	O
the	O
command	B-Application
line	I-Application
like	O
:	O
</s>
<s>
The	O
following	O
Racket	B-Operating_System
program	O
is	O
equivalent	O
to	O
the	O
above	O
Haskell	B-Language
example	O
:	O
</s>
<s>
and	O
this	O
can	O
be	O
used	O
on	O
the	O
command	B-Application
line	I-Application
as	O
follows	O
:	O
</s>
<s>
Performing	O
one-liners	O
directly	O
on	O
the	O
Unix	B-Application
command	B-Application
line	I-Application
can	O
be	O
accomplished	O
by	O
using	O
Python	B-Language
's	O
-cmd	O
flag	O
(	O
-c	O
for	O
short	O
)	O
,	O
and	O
typically	O
requires	O
the	O
import	O
of	O
one	O
or	O
more	O
modules	O
.	O
</s>
<s>
For	O
example	O
,	O
to	O
print	O
the	O
last	O
field	O
of	O
unix	B-Application
long	O
listing	O
:	O
</s>
<s>
Several	O
open-source	O
scripts	O
have	O
been	O
developed	O
to	O
facilitate	O
the	O
construction	O
of	O
Python	B-Language
one-liners	O
.	O
</s>
<s>
or	O
import	O
commonly	O
used	O
modules	O
and	O
provide	O
more	O
human-readable	O
variables	O
in	O
an	O
attempt	O
to	O
make	O
Python	B-Language
functionality	O
more	O
accessible	O
on	O
the	O
command	B-Application
line	I-Application
.	O
</s>
<s>
Here	O
is	O
a	O
redo	O
of	O
the	O
above	O
example	O
(	O
printing	O
the	O
last	O
field	O
of	O
a	O
unix	B-Application
long	O
listing	O
)	O
:	O
</s>
<s>
The	O
Python	B-Language
CGIHTTPServer	O
module	O
for	O
example	O
is	O
also	O
an	O
executable	O
library	O
that	O
performs	O
as	O
a	O
web	O
server	O
with	O
CGI	O
.	O
</s>
<s>
Tcl	B-Operating_System
(	O
Tool	B-Operating_System
Command	I-Operating_System
Language	I-Operating_System
)	O
is	O
a	O
dynamic	O
programming/scripting	O
language	O
based	O
on	O
concepts	O
of	O
Lisp	O
,	O
C	B-Language
,	O
and	O
Unix	B-Application
shells	I-Application
.	O
</s>
<s>
As	O
Tcl	B-Operating_System
commands	O
are	O
lists	O
anyway	O
,	O
the	O
following	O
is	O
a	O
full	O
substitute	O
for	O
the	O
list	O
command	O
:	O
</s>
<s>
Piping	O
semantics	O
in	O
PowerShell	B-Application
help	O
enable	O
complex	O
scenarios	O
with	O
one-liner	B-Language
programs	I-Language
.	O
</s>
<s>
This	O
one-liner	O
in	O
PowerShell	B-Application
script	O
takes	O
a	O
list	O
of	O
names	O
and	O
counts	O
from	O
a	O
comma-separated	O
value	O
file	O
,	O
and	O
returns	O
the	O
sum	O
of	O
the	O
counts	O
for	O
each	O
name	O
.	O
</s>
