* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros.
(sc_long_lines): New rule.
* HACKING: Use shorter URLs to the same material.
* doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4:
* man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c:
* src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c:
* src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c:
* src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c:
* src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm:
* tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid:
* tests/du/2g, tests/du/long-from-unreadable, tests/init.sh:
* tests/install/basic-1, tests/ls/nameless-uid:
* tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials:
* tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum:
* tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort:
* tests/misc/sort-continue, tests/misc/sort-files0-from:
* tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr:
* tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail:
* tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests:
* tests/rm/fail-2eperm, tests/rm/interactive-always:
Reformat to fit within 80 columns.
* doc/Makefile.am (BAD_POSIX_PERL): New macro.
* doc/coreutils.texi: Reword slightly, to make menus and
index lines shorter.
* src/md5sum.c: Redo --help output so that it fits within 79
columns, since that's a bit more portable and all the other --help
strings fit in 79 columns.
If you want to assign a single change, you should use the file,
doc/Copyright/request-assign.changes:
- http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.changes;hb=HEAD
+ http://www.gnu.org/software/gnulib/Copyright/request-assign.changes
If you would like to assign past and future contributions to a project,
you'd use doc/Copyright/request-assign.future:
- http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.future;hb=HEAD
+ http://www.gnu.org/software/gnulib/Copyright/request-assign.future
You may make assignments for up to four projects at a time.
sc_check-AUTHORS:
@$(MAKE) -s -C src $@
+# Look for lines longer than 80 characters, except omit:
+# - program-generated long lines in diff headers,
+# - tests involving long checksum lines, and
+# - the 'pr' test cases.
+LINE_LEN_MAX = 80
+FILTER_LONG_LINES = \
+ /^[^:]*\.diff:[^:]*:@@ / d; \
+ \|^[^:]*tests/misc/sha[0-9]*sum[-:]| d; \
+ \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
+sc_long_lines:
+ @files=$$($(VC_LIST_EXCEPT)) \
+ halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \
+ for file in $$files; do \
+ expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' | \
+ sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)'; \
+ done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
+
# Option descriptions should not start with a capital letter
# One could grep source directly as follows:
# grep -E " {2,6}-.*[^.] [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$')
$(_sc_search_regexp)
# Ensure that each file that contains fail=1 also contains fail=0.
-# Otherwise, setting file=1 in the environment would make tests fail unexpectedly.
+# Otherwise, setting file=1 in the environment would make tests fail
+# unexpectedly.
sc_prohibit_fail_0:
@prohibit='\<fail=0\>' \
halt='fail=0 initialization' \
$(AM_V_GEN)LC_ALL=C; export LC_ALL; \
{ sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \
$(top_srcdir)/src/tail.c && \
- sed -n -e 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\
+ sed -n -e \
+ 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\
$(top_srcdir)/src/shred.c; } > t-$@ \
&& mv t-$@ $@
.PHONY: $(syntax_checks) check-texinfo
# List words/regexps here that should not appear in the texinfo documentation.
+BAD_POSIX_PERL = /\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/
check-texinfo: $(syntax_checks)
$(AM_V_GEN)fail=0; \
grep '@url{' $(srcdir)/*.texi && fail=1; \
| $(EGREP) -v 'setfilename|[{]filename[}]' \
&& fail=1; \
$(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
- '/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \
+ '$(BAD_POSIX_PERL) and print,exit 1' \
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
exit $$fail
# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
sc-avoid-zeroes:
- $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || :
+ $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi \
+ && exit 1 || :
# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME = doc/Makefile
* Trailing slashes:: --strip-trailing-slashes, in some programs.
* Traversing symlinks:: -H, -L, or -P, in some programs.
* Treating / specially:: --preserve-root and --no-preserve-root.
-* Special built-in utilities:: @command{break}, @command{:}, @command{eval}, @dots{}
+* Special built-in utilities:: @command{break}, @command{:}, @dots{}
* Standards conformance:: Conformance to the @acronym{POSIX} standard.
@end menu
@macro choptH
@item -H
@opindex -H
-@cindex symbolic link to directory, traverse each that is specified on the command line
+@cindex symbolic link to directory, traverse if on the command line
If @option{--recursive} (@option{-R}) is specified and
a command line argument is a symbolic link to a directory, traverse it.
@end macro
@smallexample
od [@var{option}]@dots{} [@var{file}]@dots{}
od [-abcdfilosx]@dots{} [@var{file}] [[+]@var{offset}[.][b]]
-od [@var{option}]@dots{} --traditional [@var{file}] [[+]@var{offset}[.][b] [[+]@var{label}[.][b]]]
+od [@var{option}]@dots{} --traditional [@var{file}]@c
+ [[+]@var{offset}[.][b] [[+]@var{label}[.][b]]]
@end smallexample
Each line of output consists of the offset in the input, followed by
In such cases, running @command{\cmd\} via @command{xargs} is undesirable
because it splits the list into pieces and makes @command{\cmd\} print
\subListOutput\ for each sublist rather than for the entire list.
-One way to produce a list of @acronym{ASCII} @sc{nul} terminated file names is with @sc{gnu}
+One way to produce a list of @acronym{ASCII} @sc{nul} terminated file
+names is with @sc{gnu}
@command{find}, using its @option{-print0} predicate.
-If @var{file} is @samp{-} then the @acronym{ASCII} @sc{nul} terminated file names
-are read from standard input.
+If @var{file} is @samp{-} then the @acronym{ASCII} @sc{nul} terminated
+file names are read from standard input.
@end macro
@filesZeroFromOption{wc,,a total}
Historical (BSD and System V) implementations of @command{sort} have
differed in their interpretation of some options, particularly
-@option{-b}, @option{-f}, and @option{-n}. @sc{gnu} sort follows the @acronym{POSIX}
+@option{-b}, @option{-f}, and @option{-n}.
+@sc{gnu} sort follows the @acronym{POSIX}
behavior, which is usually (but not always!) like the System V behavior.
According to @acronym{POSIX}, @option{-n} no longer implies @option{-b}. For
consistency, @option{-M} has been changed in the same way. This may
@c and converting each @samp{\0} back to the original record delimiter.
@c
@c @example
-@c printf 'c\n\nb\n\na\n'|perl -0pe 's/\n\n/\n\0/g'|sort -z|perl -0pe 's/\0/\n/g'
+@c printf 'c\n\nb\n\na\n' |
+@c perl -0pe 's/\n\n/\n\0/g' |
+@c sort -z |
+@c perl -0pe 's/\0/\n/g'
@c @end example
@item
processing. Each output line will look like:
@smallexample
-.xx "@var{tail}" "@var{before}" "@var{keyword_and_after}" "@var{head}" "@var{ref}"
+.xx "@var{tail}" "@var{before}" "@var{keyword_and_after}"@c
+ "@var{head}" "@var{ref}"
@end smallexample
so it will be possible to write a @samp{.xx} roff macro to take care of
line will look like:
@smallexample
-\xx @{@var{tail}@}@{@var{before}@}@{@var{keyword}@}@{@var{after}@}@{@var{head}@}@{@var{ref}@}
+\xx @{@var{tail}@}@{@var{before}@}@{@var{keyword}@}@c
+@{@var{after}@}@{@var{head}@}@{@var{ref}@}
@end smallexample
@noindent
@noindent
By the way, the above idiom is not portable because it uses ranges, and
it assumes that the octal code for newline is 012.
-Assuming a @acronym{POSIX} compliant @command{tr}, here is a better way to write it:
+Assuming a @acronym{POSIX} compliant @command{tr}, here is a better
+way to write it:
@example
tr -cs '[:alnum:]' '[\n*]'
when it might be a symlink to a directory.
Otherwise, @command{mv} may do something very surprising, since
its behavior depends on the underlying rename system call.
-On a system with a modern Linux-based kernel, it fails with @code{errno=ENOTDIR}.
+On a system with a modern Linux-based kernel, it fails with
+@code{errno=ENOTDIR}.
However, on other systems (at least FreeBSD 6.1 and Solaris 10) it silently
renames not the symlink but rather the directory referenced by the symlink.
@xref{Trailing slashes}.
@opindex -x
@opindex --exact
By default, @command{shred} rounds the size of a regular file up to the next
-multiple of the file system block size to fully erase the last block of the file.
+multiple of the file system block size to fully erase the last block
+of the file.
Use @option{--exact} to suppress that behavior.
Thus, by default if you shred a 10-byte regular file on a system with 512-byte
blocks, the resulting file will be 512 bytes long. With this option,
Synopsis:
@example
-chown [@var{option}]@dots{} @{@var{new-owner} | --reference=@var{ref_file}@} @var{file}@dots{}
+chown [@var{option}]@dots{} @{@var{new-owner} | --reference=@var{ref_file}@}@c
+ @var{file}@dots{}
@end example
If used, @var{new-owner} specifies the new owner and/or group as follows
or to the group of an existing reference file. Synopsis:
@example
-chgrp [@var{option}]@dots{} @{@var{group} | --reference=@var{ref_file}@} @var{file}@dots{}
+chgrp [@var{option}]@dots{} @{@var{group} | --reference=@var{ref_file}@}@c
+ @var{file}@dots{}
@end example
If @var{group} is intended to represent a
@command{chmod} changes the access permissions of the named files. Synopsis:
@example
-chmod [@var{option}]@dots{} @{@var{mode} | --reference=@var{ref_file}@} @var{file}@dots{}
+chmod [@var{option}]@dots{} @{@var{mode} | --reference=@var{ref_file}@}@c
+ @var{file}@dots{}
@end example
@cindex symbolic links, permissions of
If an argument @var{file} is a disk device file containing a mounted
file system, @command{df} shows the space available on that file system
rather than on the file system containing the device node (i.e., the root
-file system). @sc{gnu} @command{df} does not attempt to determine the disk usage
+file system). @sc{gnu} @command{df} does not attempt to determine the
+disk usage
on unmounted file systems, because on most kinds of systems doing so
requires extremely nonportable intimate knowledge of file system
structures.
If @var{expression} is omitted, @command{test} returns false.
If @var{expression} is a single argument,
-@command{test} returns false if the argument is null and true otherwise. The argument
+@command{test} returns false if the argument is null and true
+otherwise. The argument
can be any string, including strings like @samp{-d}, @samp{-1},
@samp{--}, @samp{--help}, and @samp{--version} that most other
programs would treat as options. To get help and version information,
@opindex --file
Set the line opened by the file name specified in @var{device} instead of
the tty line connected to standard input. This option is necessary
-because opening a @acronym{POSIX} tty requires use of the @code{O_NONDELAY} flag to
-prevent a @acronym{POSIX} tty from blocking until the carrier detect line is high if
+because opening a @acronym{POSIX} tty requires use of the
+@code{O_NONDELAY} flag to prevent a @acronym{POSIX} tty from blocking
+until the carrier detect line is high if
the @code{clocal} flag is not set. Hence, it is not always possible
to allow the shell to open the device in the traditional manner.
of course).
Some settings are not available on all @acronym{POSIX} systems, since they use
-extensions. Such arguments are marked below with ``Non-@acronym{POSIX}'' in their
-description. On non-@acronym{POSIX} systems, those or other settings also may not
+extensions. Such arguments are marked below with
+``Non-@acronym{POSIX}'' in their description. On non-@acronym{POSIX}
+systems, those or other settings also may not
be available, but it's not feasible to document all the variations: just
try it and see.
@item ofill
@opindex ofill
@cindex pad instead of timing for delaying
-Use fill (padding) characters instead of timing for delays. Non-@acronym{POSIX}.
+Use fill (padding) characters instead of timing for delays.
+Non-@acronym{POSIX}.
May be negated.
@item ofdel
@opindex crtkill
Echo the @code{kill} special character by erasing each character on
the line as indicated by the @code{echoprt} and @code{echoe} settings,
-instead of by the @code{echoctl} and @code{echok} settings. Non-@acronym{POSIX}.
+instead of by the @code{echoctl} and @code{echok} settings.
+Non-@acronym{POSIX}.
May be negated.
@end table
@item rows @var{n}
@opindex rows
-Tell the tty kernel driver that the terminal has @var{n} rows. Non-@acronym{POSIX}.
+Tell the tty kernel driver that the terminal has @var{n} rows.
+Non-@acronym{POSIX}.
@item cols @var{n}
@itemx columns @var{n}
@smallexample
uname -a
-@result{} Linux dum 2.2.18 #4 SMP Tue Jun 5 11:24:08 PDT 2001 i686 unknown unknown GNU/Linux
+@result{} Linux dum 2.2.18 #4 SMP Tue Jun 5 11:24:08 PDT 2001 i686@c
+ unknown unknown GNU/Linux
@end smallexample
@smallexample
chcon [@var{option}]@dots{} @var{context} @var{file}@dots{}
-chcon [@var{option}]@dots{} [-u @var{user}] [-r @var{role}] [-l @var{range}] [-t @var{type}] @var{file}@dots{}
+chcon [@var{option}]@dots{} [-u @var{user}] [-r @var{role}] [-l @var{range}]@c
+ [-t @var{type}] @var{file}@dots{}
chcon [@var{option}]@dots{} --reference=@var{rfile} @var{file}@dots{}
@end smallexample
Synopses:
@smallexample
runcon @var{context} @var{command} [@var{args}]
-runcon [ -c ] [-u @var{user}] [-r @var{role}] [-t @var{type}] [-l @var{range}] @var{command} [@var{args}]
+runcon [ -c ] [-u @var{user}] [-r @var{role}] [-t @var{type}]@c
+ [-l @var{range}] @var{command} [@var{args}]
@end smallexample
Run @var{command} with completely-specified @var{context}, or with
Any additional arguments after @var{command}
are interpreted as arguments to the command.
-With neither @var{context} nor @var{command}, print the current security context.
+With neither @var{context} nor @var{command}, print the current
+security context.
The program accepts the following options. Also see @ref{Common options}.
@unnumberedsec Toolbox Introduction
This month's column is only peripherally related to the GNU Project, in
-that it describes a number of the GNU tools on your GNU/Linux system and how they
+that it describes a number of the GNU tools on your GNU/Linux system
+and how they
might be used. What it's really about is the ``Software Tools'' philosophy
of program development and usage.
@unnumberedsec Putting the Tools Together
Now, let's suppose this is a large ISP server system with dozens of users
-logged in. The management wants the system administrator to write a program that will
+logged in. The management wants the system administrator to write a
+program that will
generate a sorted list of logged in users. Furthermore, even if a user
is logged in multiple times, his or her name should only show up in the
output once.
@command{uniq} does. However, @command{uniq} has other uses for which one
cannot substitute @samp{sort -u}.
-The administrator puts this pipeline into a shell script, and makes it available for
+The administrator puts this pipeline into a shell script, and makes it
+available for
all the users on the system (@samp{#} is the system administrator,
or @code{root}, prompt):
#endif
],
[[
-#if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME) || HAVE_OS_H
+#if (defined BOOT_TIME \
+ || (defined CTL_KERN && defined KERN_BOOTTIME) \
+ || HAVE_OS_H)
/* your system *does* have the infrastructure to determine boot time */
#else
please_tell_us_how_to_determine_boot_time_on_your_system
# Extract usage clause(s) [if any] for SYNOPSIS.
my $PAT_USAGE = _('Usage');
my $PAT_USAGE_CONT = _('or');
-if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CONT): +\S).*)*)//om)
+if ($help_text =~ s/^($PAT_USAGE):
+ ([ ]+(\S+))
+ (.*)
+ ((?:\n(?:[ ]{6}\1|[ ]*($PAT_USAGE_CONT):[ ]+\S).*)*)//omx)
{
my @syn = $3 . $4;
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
-stdbuf \- Run COMMAND, with modified buffering operations for its standard streams.
+stdbuf \-
+Run COMMAND, with modified buffering operations for its standard streams.
[DESCRIPTION]
.\" Add any additional description here
[EXAMPLES]
( printf 'main\nusage\n_.*\n'; \
grep -h -A1 '^extern .*[^;]$$' $$src \
| grep -vE '^(extern |--)' | sed 's/ .*//'; \
- perl -ne '/^extern (?:enum )?\S+ (\S*) \(/ and print "$$1\n"' $$hdr; \
+ perl -ne '/^extern (?:enum )?\S+ (\S*) \(/ and print "$$1\n"' $$hdr; \
) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t; \
nm -e *.$(OBJEXT) \
| sed -n 's/.* T //p' \
use_fionread = false;
else
{
- error (0, errno, _("cannot do ioctl on %s"), quote (infile));
+ error (0, errno, _("cannot do ioctl on %s"),
+ quote (infile));
newlines2 = newlines;
return false;
}
&& qset_acl (dst_name, dest_desc, restrictive_temp_mode) != 0)
{
if (! owner_failure_ok (x))
- error (0, errno, _("clearing permissions for %s"), quote (dst_name));
+ error (0, errno, _("clearing permissions for %s"),
+ quote (dst_name));
return -x->require_preserve;
}
}
fputs (_("\
-a, --archive same as -dR --preserve=all\n\
--attributes-only don't copy the file data, just the attributes\n\
- --backup[=CONTROL] make a backup of each existing destination file\n\
+ --backup[=CONTROL] make a backup of each existing destination file\
+\n\
-b like --backup but does not accept an argument\n\
--copy-contents copy contents of special files when recursive\n\
-d same as --no-dereference --preserve=links\n\
"), stdout);
fputs (_("\
-f, --force if an existing destination file cannot be\n\
- opened, remove it and try again (redundant if\n\
+ opened, remove it and try again (redundant if\
+\n\
the -n option is used)\n\
- -i, --interactive prompt before overwrite (overrides a previous -n\n\
+ -i, --interactive prompt before overwrite (overrides a previous -n\
+\n\
option)\n\
-H follow command-line symbolic links in SOURCE\n\
"), stdout);
-p same as --preserve=mode,ownership,timestamps\n\
--preserve[=ATTR_LIST] preserve the specified attributes (default:\n\
mode,ownership,timestamps), if possible\n\
- additional attributes: context, links, xattr,\n\
+ additional attributes: context, links, xattr,\
+\n\
all\n\
"), stdout);
fputs (_("\
-R, -r, --recursive copy directories recursively\n\
--reflink[=WHEN] control clone/CoW copies. See below\n\
--remove-destination remove each existing destination file before\n\
- attempting to open it (contrast with --force)\n\
-"), stdout);
+ attempting to open it (contrast with --force)\
+\n"), stdout);
fputs (_("\
--sparse=WHEN control creation of sparse files. See below\n\
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
reflink_type_string, reflink_type);
break;
- case 'a': /* Like -dR --preserve=all with reduced failure diagnostics. */
+ case 'a':
+ /* Like -dR --preserve=all with reduced failure diagnostics. */
x.dereference = DEREF_NEVER;
x.preserve_links = true;
x.preserve_ownership = true;
|| S_ISDIR (stdout_stat.st_mode)
|| S_TYPEISSHM (&stdout_stat))
error (EXIT_FAILURE, ftruncate_errno,
- _("failed to truncate to %"PRIuMAX" bytes in output file %s"),
+ _("failed to truncate to %"PRIuMAX" bytes"
+ " in output file %s"),
size, quote (output_file));
}
}
`-BM' prints sizes in units of 1,048,576 bytes.\n\
See SIZE format below.\n\
--total produce a grand total\n\
- -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\
+ -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\
+\n\
-H, --si likewise, but use powers of 1000 not 1024\n\
"), stdout);
fputs (_("\
-i, --inodes list inode information instead of block usage\n\
-k like --block-size=1K\n\
-l, --local limit listing to local file systems\n\
- --no-sync do not invoke sync before getting usage info (default)\n\
+ --no-sync do not invoke sync before getting usage info (default)\
+\n\
"), stdout);
fputs (_("\
-P, --portability use the POSIX output format\n\
"), stdout);
fputs (_("\
-a, --all write counts for all files, not just directories\n\
- --apparent-size print apparent sizes, rather than disk usage; although\n\
+ --apparent-size print apparent sizes, rather than disk usage; although\
+\n\
the apparent size is usually smaller, it may be\n\
larger due to holes in (`sparse') files, internal\n\
fragmentation, indirect blocks, and the like\n\
names specified in file F;\n\
If F is - then read names from standard input\n\
-H equivalent to --dereference-args (-D)\n\
- -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\
+ -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\
+\n\
--si like -h, but use powers of 1000 not 1024\n\
"), stdout);
fputs (_("\
{
printf (_("Usage: %s [OPTION]... [USERNAME]...\n"), program_name);
fputs (_("\
-Print group memberships for each USERNAME or, if no USERNAME is specified, for\n\
+Print group memberships for each USERNAME or, if no USERNAME is specified, for\
+\n\
the current process (which may differ if the groups database has changed).\n"),
stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
"), stdout);
fputs (_("\
--preserve-context preserve SELinux security context\n\
- -Z, --context=CONTEXT set SELinux security context of files and directories\n\
+ -Z, --context=CONTEXT set SELinux security context of files and directories\
+\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
}
}
/* Note we leave %5b etc. alone so user widths/flags are honored. */
- if (strstr (long_time_format[0],"%b") || strstr (long_time_format[1],"%b"))
+ if (strstr (long_time_format[0], "%b")
+ || strstr (long_time_format[1], "%b"))
if (!abmon_init ())
error (0, 0, _("error initializing month strings"));
}
--dereference-command-line-symlink-to-dir\n\
follow each command line symbolic link\n\
that points to a directory\n\
- --hide=PATTERN do not list implied entries matching shell PATTERN\n\
+ --hide=PATTERN do not list implied entries matching shell PATTERN\
+\n\
(overridden by -a or -A)\n\
"), stdout);
fputs (_("\
- --indicator-style=WORD append indicator with style WORD to entry names:\n\
+ --indicator-style=WORD append indicator with style WORD to entry names:\
+\n\
none (default), slash (-p),\n\
file-type (--file-type), classify (-F)\n\
-i, --inode print the index number of each file\n\
- -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n\
+ -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\
+\n\
-k like --block-size=1K\n\
"), stdout);
fputs (_("\
-L, --dereference when showing file information for a symbolic\n\
link, show information for the file the link\n\
references rather than for the link itself\n\
- -m fill width with a comma separated list of entries\n\
+ -m fill width with a comma separated list of entries\
+\n\
"), stdout);
fputs (_("\
-n, --numeric-uid-gid like -l, but list numeric user and group IDs\n\
unless program is `ls' and output is a terminal)\n\
-Q, --quote-name enclose entry names in double quotes\n\
--quoting-style=WORD use quoting style WORD for entry names:\n\
- literal, locale, shell, shell-always, c, escape\n\
+ literal, locale, shell, shell-always, c, escape\
+\n\
"), stdout);
fputs (_("\
-r, --reverse reverse order while sorting\n\
-S sort by file size\n\
--sort=WORD sort by WORD instead of name: none -U,\n\
extension -X, size -S, time -t, version -v\n\
- --time=WORD with -l, show time as WORD instead of modification\n\
+ --time=WORD with -l, show time as WORD instead of modification\
+\n\
time: atime -u, access -u, use -u, ctime -c,\n\
or status -c; use specified time as sort key\n\
if --sort=time\n\
-/* Compute MD5, SHA1, SHA224, SHA256, SHA384 or SHA512 checksum of files or strings
+/* Compute checksums of files or strings.
Copyright (C) 1995-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
DIGEST_BITS);
if (O_BINARY)
fputs (_("\
- -b, --binary read in binary mode (default unless reading tty stdin)\n\
+ -b, --binary read in binary mode (default unless reading tty stdin)\n\
"), stdout);
else
fputs (_("\
- -b, --binary read in binary mode\n\
+ -b, --binary read in binary mode\n\
"), stdout);
printf (_("\
- -c, --check read %s sums from the FILEs and check them\n"),
+ -c, --check read %s sums from the FILEs and check them\n"),
DIGEST_TYPE_STRING);
if (O_BINARY)
fputs (_("\
- -t, --text read in text mode (default if reading tty stdin)\n\
+ -t, --text read in text mode (default if reading tty stdin)\n\
"), stdout);
else
fputs (_("\
- -t, --text read in text mode (default)\n\
+ -t, --text read in text mode (default)\n\
"), stdout);
fputs (_("\
\n\
The following three options are useful only when verifying checksums:\n\
- --quiet don't print OK for each successfully verified file\n\
- --status don't output anything, status code shows success\n\
- -w, --warn warn about improperly formatted checksum lines\n\
+ --quiet don't print OK for each successfully verified file\n\
+ --status don't output anything, status code shows success\n\
+ -w, --warn warn about improperly formatted checksum lines\n\
\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
name. S is modified. Return true if successful. */
static bool
-bsd_split_3 (char *s, size_t s_len, unsigned char **hex_digest, char **file_name)
+bsd_split_3 (char *s, size_t s_len, unsigned char **hex_digest,
+ char **file_name)
{
size_t i;
{
if (n_misformatted_lines != 0)
error (0, 0,
- ngettext ("WARNING: %" PRIuMAX " line is improperly formatted",
- "WARNING: %" PRIuMAX " lines are improperly formatted",
- select_plural (n_misformatted_lines)),
+ (ngettext
+ ("WARNING: %" PRIuMAX " line is improperly formatted",
+ "WARNING: %" PRIuMAX " lines are improperly formatted",
+ select_plural (n_misformatted_lines))),
n_misformatted_lines);
if (n_open_or_read_failures != 0)
error (0, 0,
- ngettext ("WARNING: %" PRIuMAX " listed file could not be read",
- "WARNING: %" PRIuMAX " listed files could not be read",
- select_plural (n_open_or_read_failures)),
+ (ngettext
+ ("WARNING: %" PRIuMAX " listed file could not be read",
+ "WARNING: %" PRIuMAX " listed files could not be read",
+ select_plural (n_open_or_read_failures))),
n_open_or_read_failures);
if (n_mismatched_checksums != 0)
error (0, 0,
- ngettext ("WARNING: %" PRIuMAX " computed checksum did NOT match",
- "WARNING: %" PRIuMAX " computed checksums did NOT match",
- select_plural (n_mismatched_checksums)),
+ (ngettext
+ ("WARNING: %" PRIuMAX " computed checksum did NOT match",
+ "WARNING: %" PRIuMAX " computed checksums did NOT match",
+ select_plural (n_mismatched_checksums))),
n_mismatched_checksums);
}
}
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
- --backup[=CONTROL] make a backup of each existing destination file\n\
+ --backup[=CONTROL] make a backup of each existing destination file\
+\n\
-b like --backup but does not accept an argument\n\
-f, --force do not prompt before overwriting\n\
-i, --interactive prompt before overwrite\n\
BYTES is hexadecimal with 0x or 0X prefix, and may have a multiplier suffix:\n\
b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
-Adding a z suffix to any type displays printable characters at the end of each\n\
+Adding a z suffix to any type displays printable characters at the end of each\
+\n\
output line.\n\
"), stdout);
fputs (_("\
}
static void
-format_address_none (uintmax_t address ATTRIBUTE_UNUSED, char c ATTRIBUTE_UNUSED)
+format_address_none (uintmax_t address ATTRIBUTE_UNUSED,
+ char c ATTRIBUTE_UNUSED)
{
}
else
{
strcpy (line, DEV_DIR_WITH_TRAILING_SLASH);
- strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
+ strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line, sizeof utmp_ent->ut_line);
line[DEV_DIR_LEN + sizeof (utmp_ent->ut_line)] = '\0';
}
/* output format */
static bool ignore_case = false; /* fold lower to upper for sorting */
-static const char *break_file = NULL; /* name of the `Break characters' file */
+static const char *break_file = NULL; /* name of the `Break chars' file */
static const char *only_file = NULL; /* name of the `Only words' file */
static const char *ignore_file = NULL; /* name of the `Ignore words' file */
static int half_line_width; /* half of line width, reference excluded */
static int before_max_width; /* maximum width of before field */
static int keyafter_max_width; /* maximum width of keyword-and-after field */
-static int truncation_string_length;/* length of string used to flag truncation */
+static int truncation_string_length;/* length of string that flags truncation */
/* When context is limited by lines, wraparound may happen on final output:
the `head' pointer gives access to some supplementary left context which
< occurs_alloc[0])
xalloc_die ();
occurs_alloc[0] = occurs_alloc[0] * 2 + 1;
- occurs_table[0] = xrealloc (occurs_table[0],
- occurs_alloc[0] * sizeof *occurs_table[0]);
+ occurs_table[0] =
+ xrealloc (occurs_table[0],
+ occurs_alloc[0] * sizeof *occurs_table[0]);
}
occurs_cursor = occurs_table[0] + number_of_occurs[0];
stdout);
fputs (_("\
-f, --canonicalize canonicalize by following every symlink in\n\
- every component of the given name recursively;\n\
+ every component of the given name recursively;\
+\n\
all but the last component must exist\n\
-e, --canonicalize-existing canonicalize by following every symlink in\n\
- every component of the given name recursively,\n\
+ every component of the given name recursively,\
+\n\
all components must exist\n\
"), stdout);
fputs (_("\
-m, --canonicalize-missing canonicalize by following every symlink in\n\
- every component of the given name recursively,\n\
+ every component of the given name recursively,\
+\n\
without requirements on components existence\n\
-n, --no-newline do not output the trailing newline\n\
-q, --quiet,\n\
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* Extracted from rm.c and librarified, then rewritten twice by Jim Meyering. */
+/* Extracted from rm.c, librarified, then rewritten twice by Jim Meyering. */
#include <config.h>
#include <stdio.h>
is non-empty\n\
"), stdout);
fputs (_("\
- -p, --parents remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is\n\
+ -p, --parents remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is\
+\n\
similar to `rmdir a/b/c a/b a'\n\
-v, --verbose output a diagnostic for every directory processed\n\
"), stdout);
program_name, program_name);
fputs (_("\
-Drop any supplemental groups, assume the user-ID and group-ID of the specified\n\
+Drop any supplemental groups, assume the user-ID and group-ID of the specified\
+\n\
USER (numeric ID or user name), and run COMMAND with any specified ARGUMENTs.\n\
Exit with status 111 if unable to assume the required user and group ID.\n\
Otherwise, exit with the exit status of COMMAND.\n\
"), stdout);
fputs (_("\
-b, --ignore-leading-blanks ignore leading blanks\n\
- -d, --dictionary-order consider only blanks and alphanumeric characters\n\
+ -d, --dictionary-order consider only blanks and alphanumeric characters\
+\n\
-f, --ignore-case fold lower case to upper case characters\n\
"), stdout);
fputs (_("\
"), stdout);
fputs (_("\
--sort=WORD sort according to WORD:\n\
- general-numeric -g, human-numeric -h, month -M,\n\
+ general-numeric -g, human-numeric -h, month -M,\
+\n\
numeric -n, random -R, version -V\n\
-V, --version-sort natural sort of (version) numbers within text\n\
\n\
"), stdout);
fputs (_("\
-c, --check, --check=diagnose-first check for sorted input; do not sort\n\
- -C, --check=quiet, --check=silent like -c, but do not report first bad line\n\
+ -C, --check=quiet, --check=silent like -c, but do not report first bad line\
+\n\
--compress-program=PROG compress temporaries with PROG;\n\
decompress them with PROG -d\n\
"), stdout);
"), stdout);
fputs (_("\
-o, --output=FILE write result to FILE instead of standard output\n\
- -s, --stable stabilize sort by disabling last-resort comparison\n\
+ -s, --stable stabilize sort by disabling last-resort comparison\
+\n\
-S, --buffer-size=SIZE use SIZE for main memory buffer\n\
"), stdout);
printf (_("\
multiple options specify multiple directories\n\
--parallel=N change the number of sorts run concurrently to N\n\
-u, --unique with -c, check for strict ordering;\n\
- without -c, output only the first of an equal run\n\
+ without -c, output only the first of an equal run\
+\n\
"), DEFAULT_TMPDIR);
fputs (_("\
-z, --zero-terminated end lines with 0 byte, not newline\n\
fputs (_("\
\n\
POS is F[.C][OPTS], where F is the field number and C the character position\n\
-in the field; both are origin 1. If neither -t nor -b is in effect, characters\n\
-in a field are counted from the beginning of the preceding whitespace. OPTS is\n\
+in the field; both are origin 1. If neither -t nor -b is in effect, characters\
+\n\
+in a field are counted from the beginning of the preceding whitespace. OPTS is\
+\n\
one or more single-letter ordering options, which override global ordering\n\
options for that key. If no key is given, use the entire line as the key.\n\
\n\
else if (files[i][0] == '\0')
{
/* Using the standard `filename:line-number:' prefix here is
- not totally appropriate, since NUL is the separator, not NL,
- but it might be better than nothing. */
+ not totally appropriate, since NUL is the separator,
+ not NL, but it might be better than nothing. */
unsigned long int file_number = i + 1;
error (SORT_FAILURE, 0,
_("%s:%lu: invalid zero-length file name"),
must continue to watch the file. It's only when following
by file descriptor that we must remove the watch. */
if ((ev->mask & IN_DELETE_SELF)
- || ((ev->mask & IN_MOVE_SELF) && follow_mode == Follow_descriptor))
+ || ((ev->mask & IN_MOVE_SELF)
+ && follow_mode == Follow_descriptor))
{
inotify_rm_watch (wd, fspec->wd);
hash_delete (wd_to_name, fspec);
else if (! (no_create || no_dereference))
{
/* Try to open FILE, creating it if necessary. */
+ int default_permissions =
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
fd = fd_reopen (STDIN_FILENO, file,
O_WRONLY | O_CREAT | O_NONBLOCK | O_NOCTTY,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ default_permissions);
/* Don't save a copy of errno if it's EISDIR, since that would lead
touch to give a bogus diagnostic for e.g., `touch /' (assuming
# {ERR => ...}
# Same as for OUT, but compare with stderr, not stdout.
# {OUT_SUBST => 's/variable_output/expected_output/'}
-# Transform actual standard output before comparing it against expected output.
+# Transform actual standard output before comparing it against expected.
# This is useful e.g. for programs like du that produce output that
# varies a lot from system. E.g., an empty file may consume zero file
# blocks, or more, depending on the OS and on the file system type.
{
my $out_file = $actual{$eo};
open IN, $out_file
- or (warn "$program_name: cannot open $out_file for reading: $!\n"),
+ or (warn
+ "$program_name: cannot open $out_file for reading: $!\n"),
$fail = 1, next;
$actual_data{$eo} = <IN>;
close IN
# a $g2 process can maintain an open file descriptor to the
# destination, but it's safer anyway.
-rw-r-----*)
- # If the file has group $g1 and is group-readable, that is definitely
- # bogus, as neither the source nor the destination was readable to group $g1.
+ # If the file has group $g1 and is group-readable, that is definitely bogus,
+ # as neither the source nor the destination was readable to group $g1.
test "$group" = "$g1" && fail=1;;
*) fail=1;;
;;
cp:*:no)
test $u = 37 &&
- expected_perms=`echo $expected_perms|sed 's/.....$/-----/'`
+ expected_perms=`
+ echo $expected_perms | sed 's/.....$/-----/'
+ `
test $u = 31 &&
- expected_perms=`echo $expected_perms|sed 's/..\(..\).$/--\1-/'`
+ expected_perms=`
+ echo $expected_perms | sed 's/..\(..\).$/--\1-/'
+ `
;;
esac
test _$actual_perms = _$expected_perms || exit 1
"$nameless_uid" "$@"
}
-nameless_uid=`$PERL -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }'`
-nameless_gid1=`$PERL -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }'`
-nameless_gid2=`$PERL -le 'foreach my $i ('"$nameless_gid1"'+1..16*1024) { getgrgid $i or (print $i), exit }'`
+nameless_uid=`$PERL -le '
+ foreach my $i (1000..16*1024-1)
+ {
+ getpwuid $i or (print $i), exit
+ }
+'`
+nameless_gid1=`$PERL -le '
+ foreach my $i (1000..16*1024)
+ {
+ getgrgid $i or (print $i), exit
+ }
+'`
+nameless_gid2=`$PERL -le '
+ foreach my $i ('"$nameless_gid1"'+1..16*1024)
+ {
+ getgrgid $i or (print $i), exit
+ }
+'`
if test -z "$nameless_uid" \
|| test -z "$nameless_gid1" \
min_kb=3000000
test $min_kb -lt $free_kb ||
{
- skip_test_ "too little free space on current partition: $free_kb (need $min_kb KB)"
+ skip_test_ \
+ "too little free space on current partition: $free_kb (need $min_kb KB)"
}
big=big
# cd $tmp || framework_failure
# Sheesh. Bash 3.1.5 can't create this hierarchy. I get
-# cd: error retrieving current directory: getcwd: cannot access parent directories:
+# cd: error retrieving current directory: getcwd:
+# cannot access parent directories:
+# (all on one line).
cwd=`pwd`
# Use perl instead:
# Eval this code in a subshell to determine a shell's suitability.
# 10 - passes all tests; ok to use
-# 9 - ok, but enabling "set -x" corrupts application stderr; prefer higher score
+# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
# ? - not ok
gl_shell_test_script_='
test $(echo y) = y || exit 1
case $template_ in
*XXXX) ;;
- *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+ *) fail_ \
+ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
esac
# First, try to use mktemp.
# hence cannot do anything meaningful with the following relative-named dirs.
iwd=`pwd`
mkdir sub || fail=1
-(cd sub && chmod 0 . && ginstall -d "$iwd/xx/yy" rel/sub1 rel/sub2 2> /dev/null) && fail=1
+(cd sub &&
+ chmod 0 . &&
+ ginstall -d "$iwd/xx/yy" rel/sub1 rel/sub2 2> /dev/null
+) && fail=1
chmod 755 sub
# Ensure that the first argument-dir has been created.
require_root_
-nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'`
+nameless_uid=`$PERL -e '
+ foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }
+'`
if test x$nameless_uid = x; then
skip_test_ "couldn't find a nameless UID"
# We use --local here so as to not activate
# potentially very many remote mounts.
mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p')
-test -z "$mount_points" && skip_test_ "this test requires a non-root mount point"
+test -z "$mount_points" &&
+ skip_test_ "this test requires a non-root mount point"
# Given e.g., /dev/shm, produce the list of GNU ls options that
# let us list just that entry using readdir data from its parent:
test "$(groups)" = "$(chroot / groups)" || fail=1
# Verify that credentials are changed correctly.
-test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP / whoami)" != root \
- || fail=1
+whoami_after_chroot=$(
+ chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP / whoami
+)
+test "$whoami_after_chroot" != root || fail=1
# Verify that there are no additional groups.
-test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups=$NON_ROOT_GROUP / id -G)"\
- = $NON_ROOT_GROUP || fail=1
+id_G_after_chroot=$(
+ chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP \
+ --groups=$NON_ROOT_GROUP / id -G
+)
+test "$id_G_after_chroot" = $NON_ROOT_GROUP || fail=1
# Verify that when specifying only the user name we get the current
# primary group ID.
. "\tonly when operating on fields\n$try"}],
# You must specify bytes or fields (or chars)
['z', '', {IN=>":\n"}, {OUT=>""}, {EXIT=>1},
- {ERR=>"$prog: you must specify a list of bytes, characters, or fields\n$try"}],
+ {ERR=>"$prog: you must specify a list of bytes, characters, or fields\n$try"}
+ ],
# Empty field list
['empty-fl', qw(-f ''), {IN=>":\n"}, {OUT=>""}, {EXIT=>1}, {ERR=>$from_1}],
# Missing field list
['out-delim3a', '-c1-3,2-4,6-', '--output-d=:', {IN=>"abcdefg\n"},
{OUT=>"abcd:fg\n"}],
# Ensure that the following two commands produce the same output.
- # Before an off-by-one fix, the output from the former would not contain a `:'.
+ # Before an off-by-1 fix, the output from the former would not contain a `:'.
['out-delim4', '-c4-,2-3', '--output-d=:',
{IN=>"abcdefg\n"}, {OUT=>"bc:defg\n"}],
['out-delim5', '-c2-3,4-', '--output-d=:',
['od-overlap2', '-b1-2,2-', '--output-d=:', {IN=>"abc\n"}, {OUT=>"abc\n"}],
['od-overlap3', '-b1-3,2-', '--output-d=:', {IN=>"abcd\n"}, {OUT=>"abcd\n"}],
['od-overlap4', '-b1-3,2-3', '--output-d=:', {IN=>"abcd\n"}, {OUT=>"abc\n"}],
- ['od-overlap5', '-b1-3,1-4', '--output-d=:', {IN=>"abcde\n"}, {OUT=>"abcd\n"}],
+ ['od-overlap5', '-b1-3,1-4', '--output-d=:',
+ {IN=>"abcde\n"}, {OUT=>"abcd\n"}],
# None of the following invalid ranges provoked an error up to coreutils-6.9.
['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
{ERR=>"$prog: invalid decreasing range\n$try"}],
['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
- ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
+ ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
+ {ERR=>$no_endpoint}],
['inval5', '-f', '1-,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval6', '-f', '-1,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
);
['tz-5wf', '+%:8z', {OUT=>"%:8z"}, {ENV=>'TZ=XXX0:01'}],
['ns-relative',
- '--iso=ns', "-d'1970-01-01 00:00:00.1234567 UTC +961062237.987654321 sec'",
+ '--iso=ns',
+ "-d'1970-01-01 00:00:00.1234567 UTC +961062237.987654321 sec'",
{OUT=>"2000-06-15T09:43:58,111111021+0000"}],
['ns-relativer', '--rfc-3339=ns',
"-d'1970-01-01 00:00:00.1234567 UTC +961062237.987654321 sec'",
# '--header' always outputs headers from the first file
# even if the headers from the second file don't match
['header-5', '--header',
- [ "ID1 Name\n1 A\n2 B\n", "ID2 Color\n1 red\n"], "ID1 Name Color\n1 A red\n", 0],
+ [ "ID1 Name\n1 A\n2 B\n", "ID2 Color\n1 red\n"],
+ "ID1 Name Color\n1 A red\n", 0],
);
. "invalid\n" }},
{AUX=> {f=> 'foo'}},
{OUT=>"f: FAILED\nf: FAILED\n"},
- {ERR=>"md5sum: WARNING: 1 line is improperly formatted\n"
- . "md5sum: WARNING: 2 computed checksums did NOT match\n"},
+ {ERR=>"md5sum: WARNING: 1 line is improperly formatted\n"
+ . "md5sum: WARNING: 2 computed checksums did NOT match\n"},
{EXIT=> 1}],
# Similar to the above, but use --warn to evoke one more diagnostic.
['check-multifail-warn', '--check', '--warn',
['check-bsd3', '--check', '--status',
{IN=> {'f.sha1' => "SHA1 (f) = $sha_degenerate\n"}},
{AUX=> {f=> 'bar'}}, {EXIT=> 1}],
- ['check-openssl', '--check', {IN=> {'f.md5' => "MD5(f)= $sha_degenerate\n"}},
+ ['check-openssl', '--check',
+ {IN=> {'f.md5' => "MD5(f)= $sha_degenerate\n"}},
{AUX=> {f=> ''}},
{ERR=>"sha1sum: f.md5: no properly formatted "
. "SHA1 checksum lines found\n"},
my @Tests =
(
['s3', {IN=> {f=> 'abc'}},
- {OUT=>"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 f\n"}],
+ {OUT=>"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 f\n"}],
['s4',
{IN=> {f=> 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'}},
- {OUT=>"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 f\n"}],
+ {OUT=>"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 f\n"}],
['s8', {IN=> {f=> 'a' x 1000000}},
- {OUT=>"20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67 f\n"}],
+ {OUT=>"20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67 f\n"}],
);
# Insert the `--text' argument for each test.
["n11b", '-s -n -k1,1', {IN=>".010\n.01a\n"}, {OUT=>".010\n.01a\n"}],
# human readable suffixes
-["h1", '-h', {IN=>"1Y\n1Z\n1E\n1P\n1T\n1G\n1M\n1K\n02\n1\nY\n-1k\n-1M\n-1G\n-1T\n-1P\n-1E\n-1Z\n-1Y\n"},
- {OUT=>"-1Y\n-1Z\n-1E\n-1P\n-1T\n-1G\n-1M\n-1k\nY\n1\n02\n1K\n1M\n1G\n1T\n1P\n1E\n1Z\n1Y\n"}],
+["h1", '-h',
+ {IN=>"1Y\n1Z\n1E\n1P\n1T\n1G\n1M\n1K\n02\n1\nY\n-1k\n-1M\n-1G\n-1T\n"
+ . "-1P\n-1E\n-1Z\n-1Y\n"},
+ {OUT=>"-1Y\n-1Z\n-1E\n-1P\n-1T\n-1G\n-1M\n-1k\nY\n1\n02\n1K\n1M\n1G\n1T\n"
+ . "1P\n1E\n1Z\n1Y\n"}],
["h2", '-h', {IN=>"1M\n-2G\n-3K"}, {OUT=>"-2G\n-3K\n1M\n"}],
# check that it works with powers of 1024
["h3", '-k 2,2h -k 1,1', {IN=>"a 1G\nb 1023M\n"}, {OUT=>"b 1023M\na 1G\n"}],
# of memcmp in the Next C library. With optimization, gcc uses its
# (working) builtin version. Test case form William Lewis.
["20a", '',
- {IN=>"_________U__free\n_________U__malloc\n_________U__abort\n_________U__memcpy\n_________U__memset\n_________U_dyld_stub_binding_helper\n_________U__malloc\n_________U___iob\n_________U__abort\n_________U__fprintf\n"},
- {OUT=>"_________U___iob\n_________U__abort\n_________U__abort\n_________U__fprintf\n_________U__free\n_________U__malloc\n_________U__malloc\n_________U__memcpy\n_________U__memset\n_________U_dyld_stub_binding_helper\n"}],
+ {IN=>"_________U__free\n_________U__malloc\n_________U__abort\n"
+ . "_________U__memcpy\n_________U__memset\n"
+ . "_________U_dyld_stub_binding_helper\n_________U__malloc\n"
+ . "_________U___iob\n_________U__abort\n_________U__fprintf\n"},
+ {OUT=>"_________U___iob\n_________U__abort\n_________U__abort\n"
+ . "_________U__fprintf\n_________U__free\n_________U__malloc\n"
+ . "_________U__malloc\n_________U__memcpy\n_________U__memset\n"
+ . "_________U_dyld_stub_binding_helper\n"}],
# Demonstrate that folding changes the ordering of e.g. A, a, and _
# because while they normally (in the C locale) collate like A, _, a,
exec 0</dev/null 3<&- 4<&- 5<&-
sort -n -m __test.* > out
) &&
-compare in out || { fail=1; echo 'file descriptor exhaustion not handled' 1>&2; }
+compare in out ||
+ { fail=1; echo 'file descriptor exhaustion not handled' 1>&2; }
echo 32 | tee -a in > in1
(
['2a', '--files0-from=-', '<',
{IN=>{f=>"g\0g\0"}}, {AUX=>{g=>'a'}}, {OUT=>"a\na\n"} ],
- # Ensure that $prog performs no processing when there is a zero-length filename
+ # Ensure that $prog does nothing when there is a zero-length filename.
# Note that the behavior here differs from `wc' in that the
# first zero-length file name is treated as fatal, so there
# should be no output on STDOUT.
LC_ALL=$locale sort --random-sort in > out2 || fail=1
# Fail if the output "randomly" is the same twice in a row.
- compare out1 out2 > /dev/null && { fail=1; echo "not random with LC_ALL=$locale" 1>&2; }
+ compare out1 out2 > /dev/null &&
+ { fail=1; echo "not random with LC_ALL=$locale" 1>&2; }
# Fail if the sorted output is not the same as the input.
sort -n out > out1
- compare in out1 || { fail=1; echo "not a permutation with LC_ALL=$locale" 1>&2; }
+ compare in out1 ||
+ { fail=1; echo "not a permutation with LC_ALL=$locale" 1>&2; }
fi
Exit $fail
getlimits_
require_built_ stdbuf
-# stdbuf fails when the absolute top build dir name contains e.g., space, TAB, NL
+# stdbuf fails when the absolute top build dir name contains e.g.,
+# space, TAB, NL
lf='
'
case $abs_top_builddir in
['i', qw(-d '[:xdigit:]'), {IN=>'w0x1y2z3456789acbdefABCDEFz'},
{OUT=>'wxyzz'}],
['j', qw(-d '[:digit:]'), {IN=>'0123456789'}, {OUT=>''}],
- ['k', qw(-d '[:digit:]'), {IN=>'a0b1c2d3e4f5g6h7i8j9k'}, {OUT=>'abcdefghijk'}],
+ ['k', qw(-d '[:digit:]'),
+ {IN=>'a0b1c2d3e4f5g6h7i8j9k'}, {OUT=>'abcdefghijk'}],
['l', qw(-d '[:lower:]'), {IN=>'abcdefghijklmnopqrstuvwxyz'}, {OUT=>''}],
['m', qw(-d '[:upper:]'), {IN=>'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}, {OUT=>''}],
['n', qw(-d '[:lower:][:upper:]'),
['u', qw(-ds b a), {IN=>'aabbaa'}, {OUT=>'a'}],
['v', qw(-ds '[:xdigit:]' Z), {IN=>'ZZ0123456789acbdefABCDEFZZ'}, {OUT=>'Z'}],
- # Try some data with 8th bit set in case something is mistakenly sign-extended.
+ # Try some data with 8th bit set in case something is mistakenly
+ # sign-extended.
['w', qw(-ds '\350' '\345'),
{IN=>"\300\301\377\345\345\350\345"},
{OUT=>"\300\301\377\345"}],
- ['x', qw(-s abcdefghijklmn '[:*016]'), {IN=>'abcdefghijklmnop'}, {OUT=>':op'}],
+ ['x', qw(-s abcdefghijklmn '[:*016]'),
+ {IN=>'abcdefghijklmnop'}, {OUT=>':op'}],
['y', qw(-d a-z), {IN=>'abc $code'}, {OUT=>' $'}],
['z', qw(-ds a-z '$.'), {IN=>'a.b.c $$$$code\\'}, {OUT=>'. $\\'}],
"$prog: printing all duplicated lines and repeat counts is meaningless\n$try"}
],
['113', '--all-repeated=separate', {IN=>"a\na\n"}, {OUT=>"a\na\n"}],
- ['114', '--all-repeated=separate', {IN=>"a\na\nb\nc\nc\n"}, {OUT=>"a\na\n\nc\nc\n"}],
- ['115', '--all-repeated=separate', {IN=>"a\na\nb\nb\nc\n"}, {OUT=>"a\na\n\nb\nb\n"}],
+ ['114', '--all-repeated=separate',
+ {IN=>"a\na\nb\nc\nc\n"}, {OUT=>"a\na\n\nc\nc\n"}],
+ ['115', '--all-repeated=separate',
+ {IN=>"a\na\nb\nb\nc\n"}, {OUT=>"a\na\n\nb\nb\n"}],
['116', '--all-repeated=prepend', {IN=>"a\na\n"}, {OUT=>"\na\na\n"}],
- ['117', '--all-repeated=prepend', {IN=>"a\na\nb\nc\nc\n"}, {OUT=>"\na\na\n\nc\nc\n"}],
+ ['117', '--all-repeated=prepend',
+ {IN=>"a\na\nb\nc\nc\n"}, {OUT=>"\na\na\n\nc\nc\n"}],
['118', '--all-repeated=prepend', {IN=>"a\nb\n"}, {OUT=>""}],
['119', '--all-repeated=badoption', {IN=>"a\n"}, {OUT=>""}, {EXIT=>1},
{ERR=>"$prog: invalid argument \`badoption' for \`--all-repeated'\n"
require_strace_ unlink
# Before the fix, mv would unnecessarily unlink the destination symlink:
-# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2; strace -qe unlink /bin/mv -T s1 s2
+# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2
+# $ strace -qe unlink /bin/mv -T s1 s2
# unlink("s2") = 0
#
# With the fix, it doesn't call unlink:
-# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2; strace -qe unlink ./mv -T s1 s2
+# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2
+# $ strace -qe unlink ./mv -T s1 s2
# $
ln -s t1 s1 || framework_failure
mv -f k "$other_partition_tmpdir" 2> out && fail=1
-cat <<EOF > exp
-mv: inter-device move failed: \`k' to \`$other_partition_tmpdir/k'; unable to remove target: Permission denied
-EOF
+printf \
+'mv: inter-device move failed: `%s'\'' to `%s'\'';'\
+' unable to remove target: Permission denied\n' \
+ k "$other_partition_tmpdir/k" >exp
# On some (less-compliant) systems, we get EPERM in this case.
# Accept either diagnostic.
# remove any site-dependent part of other-partition file name,
# and put brackets around the output.
test -s .err && {
- echo '[' | tr -d '\n'
- sed 's/^[^:][^:]*\(..\):/\1:/;s,'"$other_partition_tmpdir/,," .err
- echo ']' | tr -d '\n'
+ echo ' [' | tr -d '\n'
+ sed 's/^[^:][^:]*\(..\):/\1:/;s,'"$other_partition_tmpdir/,," .err |
+ tr -d '\n'
+ echo ']'
}
# Strip off all but the file names.
# Remove any site-dependent part of each file name.
-e "s,$other_partition_tmpdir/,," \
-e "s,$pwd_tmp/,," \
-e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`
- echo "($ls) ($ls2)"
+ echo " ("$ls") ("$ls2")"
# If the command failed, then it must not have changed the files.
if test $copy_status != 0; then
for f in $actual_args; do
test -f $f ||
- { echo "$copy FAILED but removed $f"; continue; }
+ { echo " $copy FAILED but removed $f"; continue; }
case "`cat $f`" in
"$contents") ;;
- *) echo "$copy FAILED but modified $f";;
+ *) echo " $copy FAILED but modified $f";;
esac
done
fi
fi
case "`cat $f`" in
"$contents") ;;
- *) echo $copy FAILED;;
+ *) echo " $copy FAILED";;
esac
else
- echo symlink-loop
+ echo " symlink-loop"
fi
done
fi
- ) | tr '\n' ' '
- echo
+ )
) | sed 's/ *$//'
cd ..
done
{ (exit 1); exit; }
cat <<\EOF > $expected
-1 cp loc_reg rem_sl [cp: `loc_reg' and `rem_sl' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-0 cp --rem loc_reg rem_sl (loc_reg) (rem_sl)
-0 cp --rem -d loc_reg rem_sl (loc_reg) (rem_sl)
-0 cp --rem -b loc_reg rem_sl (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
-0 cp -b loc_reg rem_sl (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
-0 cp -bd loc_reg rem_sl (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
-1 cp -d loc_reg rem_sl [cp: `loc_reg' and `rem_sl' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-
-1 cp rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-1 cp --rem rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-1 cp --rem -d rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-1 cp --rem -b rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-1 cp -b rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-0 cp -bd rem_sl loc_reg (loc_reg -> dir/loc_reg loc_reg~) (rem_sl -> dir/loc_reg) symlink-loop symlink-loop
-1 cp -d rem_sl loc_reg [cp: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-
-1 cp loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-1 cp --rem loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-1 cp --rem -d loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-1 cp --rem -b loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-1 cp -b loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-0 cp -bd loc_sl rem_reg (loc_sl -> rem_reg) (rem_reg -> rem_reg rem_reg~) symlink-loop symlink-loop
-1 cp -d loc_sl rem_reg [cp: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-
-1 cp rem_reg loc_sl [cp: `rem_reg' and `loc_sl' are the same file ](loc_sl -> rem_reg) (rem_reg)
-0 cp --rem rem_reg loc_sl (loc_sl) (rem_reg)
-0 cp --rem -d rem_reg loc_sl (loc_sl) (rem_reg)
-0 cp --rem -b rem_reg loc_sl (loc_sl loc_sl~ -> rem_reg) (rem_reg)
-0 cp -b rem_reg loc_sl (loc_sl loc_sl~ -> rem_reg) (rem_reg)
-0 cp -bd rem_reg loc_sl (loc_sl loc_sl~ -> rem_reg) (rem_reg)
-1 cp -d rem_reg loc_sl [cp: `rem_reg' and `loc_sl' are the same file ](loc_sl -> rem_reg) (rem_reg)
-
-0 mv loc_reg rem_sl () (rem_sl)
-0 mv -b loc_reg rem_sl () (rem_sl rem_sl~ -> dir/loc_reg)
-
-1 mv rem_sl loc_reg [mv: `rem_sl' and `loc_reg' are the same file ](loc_reg) (rem_sl -> dir/loc_reg)
-0 mv -b rem_sl loc_reg (loc_reg -> dir/loc_reg loc_reg~) ()
-
-1 mv loc_sl rem_reg [mv: `loc_sl' and `rem_reg' are the same file ](loc_sl -> rem_reg) (rem_reg)
-0 mv -b loc_sl rem_reg () (rem_reg -> rem_reg rem_reg~)
-
-0 mv rem_reg loc_sl (loc_sl) ()
-0 mv -b rem_reg loc_sl (loc_sl loc_sl~ -> rem_reg) ()
+1 cp loc_reg rem_sl
+ [cp: `loc_reg' and `rem_sl' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+0 cp --rem loc_reg rem_sl
+ (loc_reg) (rem_sl)
+0 cp --rem -d loc_reg rem_sl
+ (loc_reg) (rem_sl)
+0 cp --rem -b loc_reg rem_sl
+ (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
+0 cp -b loc_reg rem_sl
+ (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
+0 cp -bd loc_reg rem_sl
+ (loc_reg) (rem_sl rem_sl~ -> dir/loc_reg)
+1 cp -d loc_reg rem_sl
+ [cp: `loc_reg' and `rem_sl' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+
+1 cp rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+1 cp --rem rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+1 cp --rem -d rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+1 cp --rem -b rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+1 cp -b rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+0 cp -bd rem_sl loc_reg
+ (loc_reg -> dir/loc_reg loc_reg~) (rem_sl -> dir/loc_reg)
+ symlink-loop
+ symlink-loop
+1 cp -d rem_sl loc_reg
+ [cp: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+
+1 cp loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+1 cp --rem loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+1 cp --rem -d loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+1 cp --rem -b loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+1 cp -b loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+0 cp -bd loc_sl rem_reg
+ (loc_sl -> rem_reg) (rem_reg -> rem_reg rem_reg~)
+ symlink-loop
+ symlink-loop
+1 cp -d loc_sl rem_reg
+ [cp: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+
+1 cp rem_reg loc_sl
+ [cp: `rem_reg' and `loc_sl' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+0 cp --rem rem_reg loc_sl
+ (loc_sl) (rem_reg)
+0 cp --rem -d rem_reg loc_sl
+ (loc_sl) (rem_reg)
+0 cp --rem -b rem_reg loc_sl
+ (loc_sl loc_sl~ -> rem_reg) (rem_reg)
+0 cp -b rem_reg loc_sl
+ (loc_sl loc_sl~ -> rem_reg) (rem_reg)
+0 cp -bd rem_reg loc_sl
+ (loc_sl loc_sl~ -> rem_reg) (rem_reg)
+1 cp -d rem_reg loc_sl
+ [cp: `rem_reg' and `loc_sl' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+
+0 mv loc_reg rem_sl
+ () (rem_sl)
+0 mv -b loc_reg rem_sl
+ () (rem_sl rem_sl~ -> dir/loc_reg)
+
+1 mv rem_sl loc_reg
+ [mv: `rem_sl' and `loc_reg' are the same file]
+ (loc_reg) (rem_sl -> dir/loc_reg)
+0 mv -b rem_sl loc_reg
+ (loc_reg -> dir/loc_reg loc_reg~) ()
+
+1 mv loc_sl rem_reg
+ [mv: `loc_sl' and `rem_reg' are the same file]
+ (loc_sl -> rem_reg) (rem_reg)
+0 mv -b loc_sl rem_reg
+ () (rem_reg -> rem_reg rem_reg~)
+
+0 mv rem_reg loc_sl
+ (loc_sl) ()
+0 mv -b rem_reg loc_sl
+ (loc_sl loc_sl~ -> rem_reg) ()
EOF
# Ensure that $NON_ROOT_USERNAME can access the required version of mv.
-version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" mv --version|sed -n '1s/.* //p'`
+version=`
+ setuidgid $NON_ROOT_USERNAME env PATH="$PATH" mv --version |
+ sed -n '1s/.* //p'
+`
case $version in
$PACKAGE_VERSION) ;;
*) echo "$0: cannot access just-built mv as user $NON_ROOT_USERNAME" 1>&2
['10md', '-J -m -l 24 -f', [\'tFFt-lm', \'loli'], [\'Jml24f-lm-lo'], 0],
['10me', '-W 35 -J -m -l 24 -f', [\'tFFt-lm', \'loli'], [\'W35Jml24f-lmlo'], 0],
['10mf', '-w 35 -J -m -l 24 -f', [\'tFFt-lm', \'loli'], [\'W35Jml24f-lmlo'], 0],
-['10mg', '-n.3 -J -m -l 24 -f', [\'tFFt-lm', \'tFFt-lm', \'loli'], [\'nJml24f-lmlmlo'], 0],
-['10mh', '-n.3 -J -m -l 24 -f', [\'tFFt-lm', \'loli', \'tFFt-lm'], [\'nJml24f-lmlolm'], 0],
+['10mg', '-n.3 -J -m -l 24 -f', [\'tFFt-lm', \'tFFt-lm', \'loli'],
+ [\'nJml24f-lmlmlo'], 0],
+['10mh', '-n.3 -J -m -l 24 -f', [\'tFFt-lm', \'loli', \'tFFt-lm'],
+ [\'nJml24f-lmlolm'], 0],
['10aa', '-a -3 -l 24 -f', [\'tFFt-lm'], [\'a3l24f-lm'], 0],
['10ab', '-W 35 -a -3 -l 24 -f', [\'tFFt-lm'], [\'W35a3l24f-lm'], 0],
['10ac', '-J -a -3 -l 24 -f', [\'tFFt-lm'], [\'Ja3l24f-lm'], 0],
['10bd', '-W 35 -J -b -3 -l 24 -f', [\'tFFt-lm'], [\'W35Jb3l24f-lm'], 0],
#
# merge files (-m option) use separator string (-S option)
-['11sa', '-n.3 -S:--: -m -l 20 -f', [\'tFFt-bl', \'FnFn'], [\'nSml20-bl-FF'], 0],
-['11sb', '-n.3 -S:--: -m -l 24 -f', [\'tFFt-bl', \'FnFn'], [\'nSml24-bl-FF'], 0],
-['11se', '-n.3 -S:--: -m -l 20 -f', [\'tn', \'tn', \'FnFn'], [\'nSml20-t-t-FF'], 0],
-['11sf', '-n.3 -S:--: -m -l 24 -f', [\'tn', \'tn', \'FnFn'], [\'nSml24-t-t-FF'], 0],
-['11sg', '-n.3 -S:--: -m -l 20 -f', [\'tn', \'tn', \'FnFn', \'FnFn'], [\'nSml20-t-tFFFF'], 0],
-['11sh', '-n.3 -S:--: -m -l 24 -f', [\'tn', \'tn', \'FnFn', \'FnFn'], [\'nSml24-t-tFFFF'], 0],
+['11sa', '-n.3 -S:--: -m -l 20 -f', [\'tFFt-bl', \'FnFn'],
+ [\'nSml20-bl-FF'], 0],
+['11sb', '-n.3 -S:--: -m -l 24 -f', [\'tFFt-bl', \'FnFn'],
+ [\'nSml24-bl-FF'], 0],
+['11se', '-n.3 -S:--: -m -l 20 -f', [\'tn', \'tn', \'FnFn'],
+ [\'nSml20-t-t-FF'], 0],
+['11sf', '-n.3 -S:--: -m -l 24 -f', [\'tn', \'tn', \'FnFn'],
+ [\'nSml24-t-t-FF'], 0],
+['11sg', '-n.3 -S:--: -m -l 20 -f', [\'tn', \'tn', \'FnFn', \'FnFn'],
+ [\'nSml20-t-tFFFF'], 0],
+['11sh', '-n.3 -S:--: -m -l 24 -f', [\'tn', \'tn', \'FnFn', \'FnFn'],
+ [\'nSml24-t-tFFFF'], 0],
#
# left margin (-o option) and separator string (-S option)
['12aa', '-o3 -a -3 -l24 -f', [\'tn'], [\'o3a3l24f-tn'], 0],
['12bc', '-o3 -b -3 -S:--: -n. -l24 -f', [\'tn'], [\'o3b3Snl24f-tn'], 0],
['12ma', '-o3 -m -l24 -f', [\'tFFt-bl', \'tn'], [\'o3ml24f-bl-tn'], 0],
['12mb', '-o3 -m -S:--: -l24 -f', [\'tFFt-bl', \'tn'], [\'o3mSl24f-bl-tn'], 0],
-['12mc', '-o3 -m -S:--: -n. -l24 -f', [\'tFFt-bl', \'tn'], [\'o3mSnl24fbltn'], 0],
+['12mc', '-o3 -m -S:--: -n. -l24 -f', [\'tFFt-bl', \'tn'],
+ [\'o3mSnl24fbltn'], 0],
['12md', '-o3 -J -m -l24 -f', [\'tFFt-lm', \'loli'], [\'o3Jml24f-lm-lo'], 0],
#
#
# SunOS.5.5.1-BUG: 8 input spaces --> 11 output spaces between a and b;
['i-opt-a', '-tn -i5 -h ""', "a b\n", " 1 a b\n", 0],
# SunOS.5.5.1-BUG: 8 input spaces --> 9 output spaces between a and b;
-['i-opt-b', '-tn -i5 -o9 -h ""', "a b\n", " 1 a b\n", 0],
+['i-opt-b', '-tn -i5 -o9 -h ""', "a b\n",
+ " 1 a b\n", 0],
#
# line number overflow not allowed: cut off leading digits;
# don't adapt other UNIXes, no real standard to follow, a consequent
# programming of column handling may change the GNU pr concept.
-['ncut-a', '-tn2 -N98', "y\ny\ny\ny\ny\n", "98 y\n99 y\n00 y\n01 y\n02 y\n", 0],
-['ncut-b', '-tn:2 -N98', "y\ny\ny\ny\ny\n", "98:y\n99:y\n00:y\n01:y\n02:y\n", 0],
+['ncut-a', '-tn2 -N98', "y\ny\ny\ny\ny\n",
+ "98 y\n99 y\n00 y\n01 y\n02 y\n", 0],
+['ncut-b', '-tn:2 -N98', "y\ny\ny\ny\ny\n",
+ "98:y\n99:y\n00:y\n01:y\n02:y\n", 0],
['margin-0', '-o 0', '', '', 0],
# BUG fixed: that leading space on 3rd line of output should not be there
-['dbl-sp-a', '-d -l 14 -h ""', "1\n2\n", "\n\n-- Date/Time -- Page 1\n\n\n1\n\n2\n\n\n\n\n\n\n", 0],
+['dbl-sp-a', '-d -l 14 -h ""', "1\n2\n",
+ "\n\n-- Date/Time -- "
+ . "Page 1\n\n\n1\n\n2\n\n\n\n\n\n\n", 0],
# This test failed with 1.22e and earlier.
['dbl-sp-b', '-d -t', "1\n2\n", "1\n\n2\n\n", 0],
# Try to ensure that $NON_ROOT_USERNAME can access
# the required version of rm.
-rm_version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version|sed -n '1s/.* //p'`
+rm_version=`
+ setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version |
+ sed -n '1s/.* //p'
+`
case $rm_version in
$PACKAGE_VERSION) ;;
*) skip_test_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
cat <<\EOF > expout || fail=1
EOF
-cat <<\EOF > experr || fail=1
+sed 's/@remove_empty/rm: remove regular empty file/g' <<\EOF > experr || fail=1
no WHEN
-rm: remove regular empty file `file1-1'? rm: remove regular empty file `file1-2'? .
+@remove_empty `file1-1'? @remove_empty `file1-2'? .
WHEN=never
.
WHEN=once
rm: remove all arguments recursively? .
WHEN=always
-rm: remove regular empty file `file4-1'? rm: remove regular empty file `file4-2'? .
+@remove_empty `file4-1'? @remove_empty `file4-2'? .
-f overrides --interactive
.
--interactive overrides -f