tail
Operator
tail — copy trailing values of input sequence
Synopsis
tail [ <const-expr> ]
Description
The tail
operator copies the last N from its input to its output and ends
the sequence thereafter. N is given by <const-expr>
, a compile-time
constant expression that evaluates to a positive integer. If <const-expr>
is not provided, the value of N defaults to 1
.
Examples
Grab last two values of arbitrary sequence
tail 2
1
"foo"
[1,2,3]
Loading...
echo '1
"foo"
[1,2,3]' \
| super -z -c 'tail 2' -
Grab last two values of arbitrary sequence, using a different representation of two
tail 1+1
1
"foo"
[1,2,3]
Loading...
echo '1
"foo"
[1,2,3]' \
| super -z -c 'tail 1+1' -
Grab the last record of a record sequence
tail
{a:"hello"}
{b:"world"}
Loading...
echo '{a:"hello"}
{b:"world"}' \
| super -z -c 'tail' -