2024-02-01 20:41:42 -07:00
|
|
|
|
.\" Copyright (c) 2023–2024 DTB <trinity@trinity.moe>
|
2024-03-26 18:26:51 -06:00
|
|
|
|
.\" Copyright (c) 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
2023-12-24 17:13:17 -07:00
|
|
|
|
.\"
|
|
|
|
|
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
|
|
|
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
|
|
|
|
|
|
|
|
|
.TH npc 1
|
|
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
|
|
|
|
|
|
npc \(en show non-printing characters
|
|
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
|
|
|
|
|
npc
|
2024-03-26 18:26:51 -06:00
|
|
|
|
.RB ( -et )
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
|
|
Npc reads from standard input and writes to standard output, replacing non-
|
|
|
|
|
printing characters with printable equivalents. Control characters print as a
|
2024-03-26 18:26:51 -06:00
|
|
|
|
carat (“^”) followed by the character “@” through “_” corresponding to the
|
|
|
|
|
character replaced (e.g. control-X becomes “^X”). The delete character (0x7F)
|
|
|
|
|
becomes “^?”. Characters with the high bit set (>127) are printed as “M-”
|
2023-12-24 17:13:17 -07:00
|
|
|
|
followed by the graphical representation for the same character without the
|
|
|
|
|
high bit set.
|
2024-03-26 18:26:51 -06:00
|
|
|
|
|
2023-12-24 17:13:17 -07:00
|
|
|
|
.B -e
|
2024-03-26 18:26:51 -06:00
|
|
|
|
.RS
|
|
|
|
|
Prints a currency sign (“$”) before each line ending.
|
|
|
|
|
.RE
|
|
|
|
|
|
2023-12-24 17:13:17 -07:00
|
|
|
|
.B -t
|
2024-03-26 18:26:51 -06:00
|
|
|
|
.RS
|
|
|
|
|
Prints tab characters as “^I” rather than a literal horizontal tab.
|
|
|
|
|
.RE
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.SH DIAGNOSTICS
|
|
|
|
|
|
2024-03-26 18:26:51 -06:00
|
|
|
|
Npc prints a debug message and exits with the appropriate sysexits.h(3) error
|
2023-12-24 17:13:17 -07:00
|
|
|
|
code in the event of an error, otherwise it exits successfully.
|
|
|
|
|
|
|
|
|
|
.SH BUGS
|
|
|
|
|
|
|
|
|
|
Npc operates in single-byte chunks regardless of intended encoding.
|
|
|
|
|
|
|
|
|
|
.SH RATIONALE
|
|
|
|
|
|
|
|
|
|
POSIX currently lacks a way to display non-printing characters in the terminal
|
2024-03-26 18:26:51 -06:00
|
|
|
|
using a standard tool. A popular extension to cat(1p), the
|
|
|
|
|
.B -v
|
|
|
|
|
option, is the bandage solution GNU and other software suites use.
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
This functionality should be a separate tool because its usefulness extends
|
|
|
|
|
beyond that of cat(1p).
|
|
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
|
|
|
|
Written by DTB <trinity@trinity.moe>.
|
|
|
|
|
|
|
|
|
|
.SH COPYRIGHT
|
|
|
|
|
|
|
|
|
|
Copyright © 2023 DTB. License AGPLv3+: GNU AGPL version 3 or later
|
|
|
|
|
<https://gnu.org/licenses/agpl.html>.
|
|
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
2024-02-01 20:41:42 -07:00
|
|
|
|
cat(1p), cat-v(1)
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.I UNIX Style, or cat -v Considered Harmful
|
|
|
|
|
by Rob Pike
|