aboutsummaryrefslogtreecommitdiff
path: root/man/man1/jfp.1df
blob: eb0070bb87c3235429b423c5422763bc6eda9b54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.TH JFP 1df "January 2017" "Manual page for jfp"
.SH NAME
.B jfp
\- print input, excluding any shebang on the first line
.SH SYNOPSIS
.B jfp
FILE [FILE2 ...]
.br
.B jfp
< FILE
.P
#!/usr/bin/env jfp
.br
All this content will be printed verbatim,
.br
except for the first line,
.br
because it's a shebang.
.SH DESCRIPTION
.B jfp
prints all the input given to it except for the first line if it starts with a
shebang "#!".  This means it can be used in a shebang to simply echo the entire
remaining contents of the script.
.SH NOTES
Can you guess what it stands for?
.P
A portable way to do the same thing could be using a heredoc with cat(1):
.P
    #!/bin/sh
    cat <<'EOD'
    All this content will be printed verbatim...
    ...except for the first line...
    ...because it's a shebang.
    EOD
.P
The only snag there is having to check the token word doesn't appear in the
document.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>