File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939.Nd concatenate and print files
4040.Sh SYNOPSIS
4141.Nm
42- .Op Fl belnstuv
42+ .Op Fl Abelnstuv
4343.Op Ar
4444.Sh DESCRIPTION
45- The
4645.Nm
4746utility reads files sequentially, writing them to the standard output.
4847The
@@ -70,6 +69,15 @@ domain binding capability available in
7069.Pp
7170The options are as follows:
7271.Bl -tag -width indent
72+ .It Fl A
73+ Display non-printing characters (see the
74+ .Fl v
75+ option), display a dollar sign
76+ .Pq Ql \& $
77+ at the end of each line, and display tab characters as
78+ .Ql ^I .
79+ Equivalent to
80+ .Fl et .
7381.It Fl b
7482Number the non-blank output lines, starting at 1.
7583.It Fl e
@@ -185,7 +193,7 @@ utility is compliant with the
185193specification.
186194.Pp
187195The flags
188- .Op Fl belnstv
196+ .Op Fl Abelnstv
189197are extensions to the specification.
190198.Sh HISTORY
191199A
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ static int udom_open(const char *path, int flags);
116116#ifdef BOOTSTRAP_CAT
117117#define SUPPORTED_FLAGS "lu"
118118#else
119- #define SUPPORTED_FLAGS "belnstuv "
119+ #define SUPPORTED_FLAGS "Abelnstuv "
120120#endif
121121
122122#ifndef NO_UDOM_SUPPORT
@@ -176,6 +176,9 @@ main(int argc, char *argv[])
176176
177177 while ((ch = getopt (argc , argv , SUPPORTED_FLAGS )) != -1 )
178178 switch (ch ) {
179+ case 'A' :
180+ eflag = tflag = vflag = 1 ;
181+ break ;
179182 case 'b' :
180183 bflag = nflag = 1 ; /* -b implies -n */
181184 break ;
Original file line number Diff line number Diff line change 1+ #
2+ # SPDX-License-Identifier: BSD-2-Clause
3+ #
4+ # Copyright (c) 2026 MidnightBSD
5+ #
6+
7+ atf_test_case A_flag
8+ A_flag_head ()
9+ {
10+ atf_set " descr" " Verify that -A is equivalent to -et"
11+ }
12+
13+ A_flag_body ()
14+ {
15+ printf " tab\tchar\nnon-print\001\nend" > input
16+ atf_check -o save:expected cat -et input
17+ atf_check -o file:expected cat -A input
18+ }
19+
20+ atf_init_test_cases ()
21+ {
22+ atf_add_test_case A_flag
23+ }
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ PACKAGE= tests
33
44NETBSD_ATF_TESTS_SH = cat_test
55
6+ ATF_TESTS_SH+ = A_flag_test
7+
68${PACKAGE}FILES+ = d_align.in
79${PACKAGE}FILES+ = d_align.out
810${PACKAGE}FILES+ = d_b_output.in
You can’t perform that action at this time.
0 commit comments