Don't assume that "echo" lives in /bin.

* xargs/xargs.c (main): Change default_cmd from "/bin/echo" (which
may not be present on some POSIX systems) to "echo" (which must
exist somewhere on $PATH on any POSIX system).
* doc/find.texi (Multiple Files): document this.
* NEWS: Describe this change.
* xargs/testsuite/xargs.sysv/empty_def-t.xe: Change /bin/echo to
echo.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.exp: Change -s26 to -s21 to
keep the expected test result the same.  Rename the test to
reflect the updated arguments.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.xo: Rename to
n2-s21-x-0.xo.
* xargs/testsuite/xargs.gnu/n2-s26-0.exp: Rename to n2-s21-0.exp,
update -s argument.
* xargs/testsuite/xargs.posix/s30.exp: Rename to s25.exp, update -s.
* xargs/testsuite/xargs.posix/s30.xo: Rename to s25.xo.
* xargs/testsuite/xargs.gnu/s30-0.exp: Rename to s25-0.exp, update
-s argument.
* xargs/testsuite/xargs.gnu/s30-0.xo: Rename to s25-0.xo.
* xargs/testsuite/xargs.sysv/s30-t.exp: Rename to s25-t.exp,
update -s.
* xargs/testsuite/xargs.sysv/s30-t.xo: Rename to s25-t.xo.
* xargs/testsuite/xargs.sysv/s30-t.xe: Rename to s25-t.xe, change
/bin/echo to just echo.
* xargs/testsuite/xargs.posix/s47.exp: Rename to s42.exp, update -s.
* xargs/testsuite/xargs.posix/s47.xo: Rename to s42.xo.
* xargs/testsuite/xargs.gnu/n3-s36-0.exp: Rename to n3-s31-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/n3-s36-0.xo: Rename to n3-s31-0.xo.
* xargs/testsuite/xargs.gnu/s20-0.exp: Rename to s15-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s20-0.xo: Rename to s15-0.xo.
* xargs/testsuite/xargs.posix/n2-s26.exp: Rename to n2-s21.exp,
update -s.
* xargs/testsuite/xargs.posix/n2-s26.xo: Rename to n2-s21.xo.
* xargs/testsuite/xargs.gnu/s19-0.exp: Rename to s14-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s19-0.xo: Rename to s14-0.xo.
* xargs/testsuite/xargs.gnu/s19_2-0.exp: Rename to s14_2-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/s19_2-0.xo: Rename to s14_2-0.xo.
* xargs/testsuite/xargs.posix/n3-s36.exp: Rename to n3-s31.exp,
update -s.
* xargs/testsuite/xargs.posix/n3-s36.xo: Rename to n3-s31.xo.
* xargs/testsuite/xargs.posix/s19.exp: Rename to s14.exp, update
-s.
* xargs/testsuite/xargs.posix/s19.xo: Rename to s14.xo.
* xargs/testsuite/xargs.posix/s19_2.exp: Rename to s14_2.exp,
update -s.
* xargs/testsuite/xargs.posix/s19_2.xo: Rename to s14_2.xo.
* xargs/testsuite/xargs.posix/s20.exp: Rename to s15.exp,
update -s.
* xargs/testsuite/xargs.posix/s20.xo: Rename to s15.xo.
* xargs/testsuite/Makefile.am (EXTRA_DIST_XO): Update names.
(EXTRA_DIST_EXP): Likewise.
This commit is contained in:
James Youngman
2011-05-22 02:43:31 +01:00
parent b28cc8c493
commit 804ff7b90e
54 changed files with 122 additions and 57 deletions

View File

@@ -1,3 +1,62 @@
2011-05-22 James Youngman <jay@gnu.org>
Don't assume that "echo" lives in /bin.
* xargs/xargs.c (main): Change default_cmd from "/bin/echo" (which
may not be present on some POSIX systems) to "echo" (which must
exist somewhere on $PATH on any POSIX system).
* doc/find.texi (Multiple Files): document this.
* NEWS: Describe this change.
* xargs/testsuite/xargs.sysv/empty_def-t.xe: Change /bin/echo to
echo.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.exp: Change -s26 to -s21 to
keep the expected test result the same. Rename the test to
reflect the updated arguments.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.xo: Rename to
n2-s21-x-0.xo.
* xargs/testsuite/xargs.gnu/n2-s26-0.exp: Rename to n2-s21-0.exp,
update -s argument.
* xargs/testsuite/xargs.posix/s30.exp: Rename to s25.exp, update -s.
* xargs/testsuite/xargs.posix/s30.xo: Rename to s25.xo.
* xargs/testsuite/xargs.gnu/s30-0.exp: Rename to s25-0.exp, update
-s argument.
* xargs/testsuite/xargs.gnu/s30-0.xo: Rename to s25-0.xo.
* xargs/testsuite/xargs.sysv/s30-t.exp: Rename to s25-t.exp,
update -s.
* xargs/testsuite/xargs.sysv/s30-t.xo: Rename to s25-t.xo.
* xargs/testsuite/xargs.sysv/s30-t.xe: Rename to s25-t.xe, change
/bin/echo to just echo.
* xargs/testsuite/xargs.posix/s47.exp: Rename to s42.exp, update -s.
* xargs/testsuite/xargs.posix/s47.xo: Rename to s42.xo.
* xargs/testsuite/xargs.gnu/n3-s36-0.exp: Rename to n3-s31-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/n3-s36-0.xo: Rename to n3-s31-0.xo.
* xargs/testsuite/xargs.gnu/s20-0.exp: Rename to s15-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s20-0.xo: Rename to s15-0.xo.
* xargs/testsuite/xargs.posix/n2-s26.exp: Rename to n2-s21.exp,
update -s.
* xargs/testsuite/xargs.posix/n2-s26.xo: Rename to n2-s21.xo.
* xargs/testsuite/xargs.gnu/s19-0.exp: Rename to s14-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s19-0.xo: Rename to s14-0.xo.
* xargs/testsuite/xargs.gnu/s19_2-0.exp: Rename to s14_2-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/s19_2-0.xo: Rename to s14_2-0.xo.
* xargs/testsuite/xargs.posix/n3-s36.exp: Rename to n3-s31.exp,
update -s.
* xargs/testsuite/xargs.posix/n3-s36.xo: Rename to n3-s31.xo.
* xargs/testsuite/xargs.posix/s19.exp: Rename to s14.exp, update
-s.
* xargs/testsuite/xargs.posix/s19.xo: Rename to s14.xo.
* xargs/testsuite/xargs.posix/s19_2.exp: Rename to s14_2.exp,
update -s.
* xargs/testsuite/xargs.posix/s19_2.xo: Rename to s14_2.xo.
* xargs/testsuite/xargs.posix/s20.exp: Rename to s15.exp,
update -s.
* xargs/testsuite/xargs.posix/s20.xo: Rename to s15.xo.
* xargs/testsuite/Makefile.am (EXTRA_DIST_XO): Update names.
(EXTRA_DIST_EXP): Likewise.
2011-05-17 James Youngman <jay@gnu.org>
Document ftsfind/oldfind and configure options.

8
NEWS
View File

@@ -21,7 +21,13 @@ installed, whichever is appropriate.
#32043: find -name [ doesn't obey posix
** Functional Enhancements to xargs
** Functional Changes to xargs
If no utility is specified, xargs now calls "echo" (and searches on
$PATH to find it) rather than "/bin/echo". This may give rise to
subtle behaviour differences for some users. To avoid unexpected
surprises, just explicitly specify the utility you would like to run.
For example use "xargs /bin/echo < foo" rather than "xargs < foo".
A new option is provided, --process-slot-var. If you set this, xargs
will set the indicated environment variable in each child. The values

View File

@@ -2203,7 +2203,7 @@ xargs @r{[}@var{option}@dots{}@r{]} @r{[}@var{command} @r{[}@var{initial-argumen
@code{xargs} normally reads arguments from the standard input. These
arguments are delimited by blanks (which can be protected with double
or single quotes or a backslash) or newlines. It executes the
@var{command} (default is @file{/bin/echo}) one or more times with any
@var{command} (the default is @file{echo}) one or more times with any
@var{initial-arguments} followed by arguments read from standard
input. Blank lines on the standard input are ignored. If the
@samp{-L} option is in use, trailing blanks indicate that @code{xargs}

View File

@@ -20,19 +20,19 @@ xargs.gnu/L2_2-0.exp \
xargs.gnu/L3-0.exp \
xargs.gnu/n1-0.exp \
xargs.gnu/n2-0.exp \
xargs.gnu/n2-s26-0.exp \
xargs.gnu/n2-s26-x-0.exp \
xargs.gnu/n2-s21-0.exp \
xargs.gnu/n2-s21-x-0.exp \
xargs.gnu/n3-0.exp \
xargs.gnu/n3-s36-0.exp \
xargs.gnu/n3-s31-0.exp \
xargs.gnu/noeof-0.exp \
xargs.gnu/nothing.exp \
xargs.gnu/P3-n1-IARG.exp \
xargs.gnu/r.exp \
xargs.gnu/s118-0.exp \
xargs.gnu/s19-0.exp \
xargs.gnu/s19_2-0.exp \
xargs.gnu/s20-0.exp \
xargs.gnu/s30-0.exp \
xargs.gnu/s14_2-0.exp \
xargs.gnu/s14-0.exp \
xargs.gnu/s15-0.exp \
xargs.gnu/s25-0.exp \
xargs.gnu/space-0.exp \
xargs.gnu/space-r.exp \
xargs.gnu/space-t-0.exp \
@@ -56,10 +56,10 @@ xargs.posix/L2-n2.exp \
xargs.posix/L3.exp \
xargs.posix/n1.exp \
xargs.posix/n2.exp \
xargs.posix/n2-s26.exp \
xargs.posix/n2-s26-x.exp \
xargs.posix/n2-s21.exp \
xargs.posix/n2-s21-x.exp \
xargs.posix/n3.exp \
xargs.posix/n3-s36.exp \
xargs.posix/n3-s31.exp \
xargs.posix/noeof.exp \
xargs.posix/quotes.exp \
xargs.posix/rc-123.exp \
@@ -68,12 +68,12 @@ xargs.posix/rc-125.exp \
xargs.posix/rc-126.exp \
xargs.posix/rc-127.exp \
xargs.posix/s118.exp \
xargs.posix/s19_2.exp \
xargs.posix/s19.exp \
xargs.posix/s20.exp \
xargs.posix/s30.exp \
xargs.posix/s14.exp \
xargs.posix/s14_2.exp \
xargs.posix/s15.exp \
xargs.posix/s25.exp \
xargs.posix/s42.exp \
xargs.posix/s470.exp \
xargs.posix/s47.exp \
xargs.posix/s48.exp \
xargs.posix/s6.exp \
xargs.posix/savannah-11865.exp \
@@ -98,7 +98,7 @@ xargs.sysv/l1_2.exp \
xargs.sysv/l1.exp \
xargs.sysv/l1n4.exp \
xargs.sysv/lc_l2.exp \
xargs.sysv/s30-t.exp \
xargs.sysv/s25-t.exp \
xargs.sysv/sv-bug-18713.exp \
xargs.sysv/space-t.exp \
xargs.sysv/trace.exp
@@ -118,18 +118,18 @@ xargs.gnu/L2_2-0.xo \
xargs.gnu/L3-0.xo \
xargs.gnu/n1-0.xo \
xargs.gnu/n2-0.xo \
xargs.gnu/n2-s26-0.xo \
xargs.gnu/n2-s26-x-0.xo \
xargs.gnu/n2-s21-0.xo \
xargs.gnu/n2-s21-x-0.xo \
xargs.gnu/n3-0.xo \
xargs.gnu/n3-s36-0.xo \
xargs.gnu/n3-s31-0.xo \
xargs.gnu/noeof-0.xo \
xargs.gnu/nothing.xo \
xargs.gnu/P3-n1-IARG.xo \
xargs.gnu/r.xo \
xargs.gnu/s118-0.xo \
xargs.gnu/s19-0.xo \
xargs.gnu/s20-0.xo \
xargs.gnu/s30-0.xo \
xargs.gnu/s14-0.xo \
xargs.gnu/s15-0.xo \
xargs.gnu/s25-0.xo \
xargs.gnu/space-0.xo \
xargs.gnu/space-t-0.xo \
xargs.posix/EEOFb.xo \
@@ -148,20 +148,20 @@ xargs.posix/L2-n2.xo \
xargs.posix/uc_L2.xo \
xargs.posix/L3.xo \
xargs.posix/n1.xo \
xargs.posix/n2-s26.xo \
xargs.posix/n2-s26-x.xo \
xargs.posix/n2-s21.xo \
xargs.posix/n2-s21-x.xo \
xargs.posix/n2.xo \
xargs.posix/n3-s36.xo \
xargs.posix/n3-s31.xo \
xargs.posix/n3.xo \
xargs.posix/noeof.xo \
xargs.posix/quotes.xo \
xargs.posix/rc-123.xo \
xargs.posix/s118.xo \
xargs.posix/s19.xo \
xargs.posix/s20.xo \
xargs.posix/s30.xo \
xargs.posix/s14.xo \
xargs.posix/s15.xo \
xargs.posix/s25.xo \
xargs.posix/s42.xo \
xargs.posix/s470.xo \
xargs.posix/s47.xo \
xargs.posix/s48.xo \
xargs.posix/savannah-11865.xo \
xargs.posix/space.xo \
@@ -183,7 +183,7 @@ xargs.sysv/l1_2.xo \
xargs.sysv/l1n4.xo \
xargs.sysv/l1.xo \
xargs.sysv/lc_l2.xo \
xargs.sysv/s30-t.xo \
xargs.sysv/s25-t.xo \
xargs.sysv/sv-bug-18713.xo \
xargs.sysv/space-t.xo \
xargs.sysv/trace.xo
@@ -194,7 +194,7 @@ EXTRA_DIST_XE = \
xargs.gnu/space-t-0.xe \
xargs.sysv/empty_def-t.xe \
xargs.sysv/empty-t.xe \
xargs.sysv/s30-t.xe \
xargs.sysv/s25-t.xe \
xargs.sysv/space-t.xe \
xargs.sysv/trace.xe

View File

@@ -0,0 +1 @@
xargs_start p {-n2 -s21 -0} stairs-0.xi

View File

@@ -0,0 +1 @@
xargs_start f {-n2 -s21 -x -0} stairs-0.xi skip

View File

@@ -1 +0,0 @@
xargs_start p {-n2 -s26 -0} stairs-0.xi

View File

@@ -1 +0,0 @@
xargs_start f {-n2 -s26 -x -0} stairs-0.xi skip

View File

@@ -0,0 +1 @@
xargs_start p {-n3 -s31 -0} stairs2-0.xi

View File

@@ -1 +0,0 @@
xargs_start p {-n3 -s36 -0} stairs2-0.xi

View File

@@ -0,0 +1 @@
xargs_start f {-0 -s14} stairs-0.xi skip

View File

@@ -0,0 +1 @@
xargs_start f {-0 -s14} stairs2-0.xi skip

View File

@@ -0,0 +1 @@
xargs_start p {-0 -s15} stairs-0.xi

View File

@@ -1 +0,0 @@
xargs_start f {-0 -s19} stairs-0.xi skip

View File

@@ -1 +0,0 @@
xargs_start f {-0 -s19} stairs2-0.xi skip

View File

@@ -1 +0,0 @@
xargs_start p {-0 -s20} stairs-0.xi

View File

@@ -0,0 +1 @@
xargs_start p {-0 -s25} stairs-0.xi

View File

@@ -1 +0,0 @@
xargs_start p {-0 -s30} stairs-0.xi

View File

@@ -0,0 +1 @@
xargs_start f {-n2 -s21 -x} stairs.xi skip

View File

@@ -0,0 +1 @@
xargs_start p {-n2 -s21} stairs.xi

View File

@@ -1 +0,0 @@
xargs_start f {-n2 -s26 -x} stairs.xi skip

View File

@@ -1 +0,0 @@
xargs_start p {-n2 -s26} stairs.xi

View File

@@ -0,0 +1 @@
xargs_start p {-n3 -s31} stairs2.xi

View File

@@ -1 +0,0 @@
xargs_start p {-n3 -s36} stairs2.xi

View File

@@ -0,0 +1 @@
xargs_start f {-s14} stairs.xi skip

View File

@@ -0,0 +1 @@
xargs_start f {-s14} stairs2.xi skip

View File

@@ -0,0 +1 @@
xargs_start p {-s15} stairs.xi

View File

@@ -1 +0,0 @@
xargs_start f {-s19} stairs.xi skip

View File

@@ -1 +0,0 @@
xargs_start f {-s19} stairs2.xi skip

View File

@@ -1 +0,0 @@
xargs_start p {-s20} stairs.xi

View File

@@ -0,0 +1 @@
xargs_start p {-s25} stairs.xi

View File

@@ -1 +0,0 @@
xargs_start p {-s30} stairs.xi

View File

@@ -0,0 +1 @@
xargs_start f {-s42} files.xi skip

View File

@@ -1 +0,0 @@
xargs_start f {-s47} files.xi skip

View File

@@ -1 +1 @@
/bin/echo
echo

View File

@@ -0,0 +1 @@
xargs_start p {-s25 -t} stairs.xi

View File

@@ -0,0 +1,6 @@
echo 1 22 333 4444 55555
echo 666666 7777777
echo 88888888 999999999
echo 1 22 333 4444 55555
echo 666666 7777777
echo 88888888 999999999

View File

@@ -1 +0,0 @@
xargs_start p {-s30 -t} stairs.xi

View File

@@ -1,6 +0,0 @@
/bin/echo 1 22 333 4444 55555
/bin/echo 666666 7777777
/bin/echo 88888888 999999999
/bin/echo 1 22 333 4444 55555
/bin/echo 666666 7777777
/bin/echo 88888888 999999999

View File

@@ -383,7 +383,7 @@ main (int argc, char **argv)
int show_limits = 0; /* --show-limits */
int always_run_command = 1;
char *input_file = "-"; /* "-" is stdin */
char *default_cmd = "/bin/echo";
char *default_cmd = "echo";
int (*read_args) (void) = read_line;
void (*act_on_init_result)(void) = noop;
enum BC_INIT_STATUS bcstatus;