bugfindutils - Bugs: bug #14587, -L does not default to -L1 and...

 
 

bug #14587: -L does not default to -L1 and results in error

Submitter:  None
Submitted:  Mon 19 Sep 2005 06:25:10 PM UTC
   
 
Category:  documentation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Jason Pyeron Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.2.11
Fixed Release:  4.2.26
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 21 Sep 2005 09:05:20 AM UTC, comment #4: 

I've just applied the following patch, which should fix these remaining problems.

James Youngman <jay>
Group administrator
Wed 21 Sep 2005 03:12:27 AM UTC, comment #3: 

However, your patch did not clarify that -E also requires an argument (not to mention that xargs --help doesn't even mention -E).  Plus, it is a bit inconsistent that you list -l before -L, but -I before -i.

Further, `xargs -L' still warns about -l being invalid, so you didn't quite apply ldv's patch correctly.

Eric Blake <ericb>
Group administrator
Tue 20 Sep 2005 06:42:55 PM UTC, comment #2: 

I attach a patch which I applied to clarify the situation (sorry ldv, I didn't spot that you have already created a patch).

James Youngman <jay>
Group administrator
Mon 19 Sep 2005 08:49:14 PM UTC, comment #1: 

See also http://lists.gnu.org/archive/html/bug-findutils/2005-08/msg00037.html.  POSIX requires -L to have a required argument, but -l can have an optional argument.  So it is only -l that defaults to 1.  The documentation is buggy.

However, looking at the output of the program, it is a bit odd that the error message for -L refers to -l - that could be improved.

Eric Blake <ericb>
Group administrator
Mon 19 Sep 2005 06:25:10 PM UTC, original submission:  



from man xargs:

 --max-lines[=max-lines], -L[max-lines]
     Use  at  most max-lines nonblank input lines per command line; max-lines defaults to 1 if omitted.
     Trailing blanks cause an input line to be logically continued on the next input line.  Implies -x.




[jpyeron@mrlaptop rpms.pdinc.us]$ find | perl -ne 'm/(.+)\/.+\.rpm$/ and print $1, "\n";' | sort -u | xargs -L echo
xargs: invalid number for -l option
Usage: xargs [-0prtx] [-e[eof-str]] [-i[replace-str]] [-l[max-lines]]
       [-n max-args] [-s max-chars] [-P max-procs] [--null] [--eof[=eof-str]]
       [--replace[=replace-str]] [--max-lines[=max-lines]] [--interactive]
       [--max-chars=max-chars] [--verbose] [--exit] [--max-procs=max-procs]
       [--max-args=max-args] [--no-run-if-empty] [--arg-file=file]
       [--version] [--help] [command [initial-arguments]]

Report bugs to <bug-findutils@gnu.org>.
[jpyeron@mrlaptop rpms.pdinc.us]$ find | perl -ne 'm/(.+)\/.+\.rpm$/ and print $1, "\n";' | sort -u | xargs -l echo
./SRPMS
./foo bar
./i386
[jpyeron@mrlaptop rpms.pdinc.us]$ find | perl -ne 'm/(.+)\/.+\.rpm$/ and print $1, "\n";' | sort -u | xargs -L1 echo
./SRPMS
./foo bar
./i386
[jpyeron@mrlaptop rpms.pdinc.us]$


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #3154:  e-option.patch added by jay (3KiB - application/octet-stream - Clarifications to -E)
file #3183:  xargs.c.diff added by ldv (616B - Proposed error message fix as suggested by Eric Blake)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-19 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.26
2005-09-21 jay Attached File- Added e-option.patch, #2976
2005-09-20 jay Categoryxargs documentation
    StatusNone Fixed
    Assigned toNone jay
2005-09-19 ldv Attached File- Added xargs.c.diff, #2969
2005-09-19 None Carbon-Copy- Added jpyeron --AT-- pdinc --DOT-- us

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code