aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xargs
Commit message (Collapse)AuthorAgeFilesLines
* Style(9) changes fo xargs.cEitan Adler2013-05-101-2/+4
| | | | Notes: svn path=/head/; revision=250431
* Follow calloc convention in other code, this is functionally identicalXin LI2013-01-051-1/+1
| | | | | | | to its previous form. Notes: svn path=/head/; revision=245050
* xargs: Before exiting, wait for all invocations of the utility.Jilles Tjoelker2012-03-162-45/+81
| | | | | | | | | | This only has an effect with -P, otherwise errors are only detected when the utility is not running. Submitted by: Matthew Story Notes: svn path=/head/; revision=233038
* xargs: Remove an unclear comment that only tried to repeat what the code didJilles Tjoelker2012-02-261-4/+0
| | | | | | | Reported by: bde Notes: svn path=/head/; revision=232201
* xargs: Fix comma splice in error message.Jilles Tjoelker2012-02-261-2/+2
| | | | | | | Reported by: bde Notes: svn path=/head/; revision=232187
* xargs: If a utility exits with 255 or a signal, write an error message.Jilles Tjoelker2012-02-241-4/+7
| | | | | | | | | | | If a utility called by xargs exits with status 255 or because of a signal, POSIX requires writing an error message. PR: 165155 Submitted by: Matthew Story matthewstory gmail com Notes: svn path=/head/; revision=232108
* Discourage from using "cp -r".Ruslan Ermilov2011-03-241-2/+2
| | | | Notes: svn path=/head/; revision=219958
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-113-12/+2
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Various syntactic tweaks to satisfy style(9). No change to execution.Stephen McKay2010-11-211-14/+14
| | | | | | | Submitted by: gcooper@ Notes: svn path=/head/; revision=215642
* xargs can be fooled by exiting children that it did not start, causingStephen McKay2010-11-211-5/+118
| | | | | | | | | | | | | it to kick off a new command before the previous has finished, resulting in corrupted (interleaved) output. It is also fooled by non-exiting children it did not start, failing to exit until all extraneous children have exited. This patch makes xargs keep track of children it starts, ignoring pre-existing ones. Notes: svn path=/head/; revision=215615
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Revive '-opt' flags which I accidentally removed.Giorgos Keramidas2008-01-271-1/+1
| | | | | | | Noticed by: simon Notes: svn path=/head/; revision=175728
* Document the no-op -r option of BSD xargs(1).Giorgos Keramidas2008-01-261-2/+30
| | | | | | | | | PR: docs/106416 Submitted by: Pete Slagle, freebsd-stable at voidcaptain.com MFC after: 3 days Notes: svn path=/head/; revision=175680
* Markup fixes.Ruslan Ermilov2006-09-291-3/+3
| | | | Notes: svn path=/head/; revision=162792
* NUL terminate buffer from fgetln(3). From fgsch@OpenBSD.Juli Mallett2006-01-011-0/+1
| | | | Notes: svn path=/head/; revision=153960
* Whitespace after switch.Juli Mallett2006-01-011-3/+3
| | | | | | | Inspired by: OpenBSD Notes: svn path=/head/; revision=153959
* Check the entire length of the current argument for the EOF string with -E,Juli Mallett2005-12-311-1/+1
| | | | | | | | | | | | | | | | but don't expect a proper ASCII string to exist right here right now, don't use strcmp(3) which checks for a NUL. As we're still building the argument up, the next character might be garbage. It would probably be just as safe to temporarily write a NUL there, but if we've reached the end of argument memory that might not be the best idea, I think. It's unclear. Doing it this way seems to meet the most with the original intent. PR: 85696 Prodded by: stefanf Notes: svn path=/head/; revision=153934
* Add a FreeBSD-specific -S flag which controls the maximum size of an argumentJuli Mallett2005-12-302-10/+34
| | | | | | | having replacements done in it via -I. Notes: svn path=/head/; revision=153918
* Handle maxsize==0 in such a way that we don't modify the string.Juli Mallett2005-12-301-0/+12
| | | | Notes: svn path=/head/; revision=153917
* Wording tweaks.Dag-Erling Smørgrav2005-12-071-3/+2
| | | | | | | | PR: not quite docs/84620 MFC after: 2 weeks Notes: svn path=/head/; revision=153198
* Add -r option for GNU compatibility.Dag-Erling Smørgrav2005-12-071-1/+4
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=153196
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-05-211-1/+1
| | | | Notes: svn path=/head/; revision=146466
* MFC 1.22: Fix -0 vs -L/-I processing, mainly so that 'xargs -0 -I []' willGarance A Drosehn2005-02-271-2/+9
| | | | | | | | | | do something sensible (namely: treat then '\0' as the EOL character, when deciding what "a line" is for -N). Note that -I implies -N. MFC after: 3 days Notes: svn path=/head/; revision=142604
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Modify behaviour of `xargs -I` in order to:Colin Percival2004-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | 1. Conform to IEEE Std 1003.1-2004, which state that "Constructed arguments cannot grow larger than 255 bytes", and 2. Avoid a buffer overflow. Unfortunately the standard doesn't indicate how xargs is supposed to handle arguments which (with the appropriate substitutions) would grow larger than 255 bytes; this solution handles those by making as many substitutions as possible without overflowing the buffer. OpenBSD's xargs resolves this in a different direction, by making all the substitutions and then silently truncating the resulting string. Since this change may break existing scripts which rely upon the buffer overflow (255 bytes isn't really all that long...) it will not be MFCed. Notes: svn path=/head/; revision=136664
* Document incorrect handling of multibyte characters with -I and -J options.Tim J. Robbins2004-08-021-1/+10
| | | | Notes: svn path=/head/; revision=132998
* Call setlocale() with category LC_ALL instead of LC_MESSAGES. We needTim J. Robbins2004-07-121-1/+1
| | | | | | | | | LC_CTYPE and LC_COLLATE to correctly interpret regular expressions returned by nl_langinfo(YESEXPR), and it doesn't hurt to include the rest. Notes: svn path=/head/; revision=132008
* Fix spelling error in my own paragraph.Dima Dorfman2004-06-281-1/+1
| | | | Notes: svn path=/head/; revision=131229
* - Use _PATH_TTY and _PATH_DEVNULL macros.Maxime Henrion2003-06-131-5/+9
| | | | | | | | | | | | | | - Don't fail if we can't open /dev/null since this can happen if xargs is jail'ed or chroot'ed. These fixes were submitted by Todd Miller from the OpenBSD project. There was one problem in those fixes that broke -o, which is corrected here and should be committed to the OpenBSD repo by Todd soon. MFC in: 3 days Notes: svn path=/head/; revision=116302
* Use waitpid, instead of wait3, which is more portable.Juli Mallett2003-06-131-2/+2
| | | | | | | | | Submitted by: "Todd C. Miller" <Todd.Miller@courtesan.com> Obtained from: OpenBSD Reviewed by: tjr Notes: svn path=/head/; revision=116287
* Remove redundant return; from void function.Juli Mallett2003-06-131-1/+0
| | | | | | | | Submitted by: "Todd C. Miller" <Todd.Miller@courtesan.com> Obtained from: OpenBSD Notes: svn path=/head/; revision=116285
* Markup bits.Ruslan Ermilov2003-05-211-1/+1
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115217
* Don't shaddow exp(3).David E. O'Brien2003-05-031-6/+5
| | | | Notes: svn path=/head/; revision=114591
* Migrate to a new way of dealing with building from old revisions ofWarner Losh2003-04-051-14/+1
| | | | | | | | | | | | | | | | | | | | FreeBSD. This method attempts to centralize all the necessary hacks or work arounds in one of two places in the tree (src/Makefile.inc1 and src/tools/build). We build a small compatibility library (libbuild.a) as well as selectively installing necessary include files. We then include this directory when building host binaries. This removes all the past release compatibilty hacks from various places in the tree. We still build on tip of stable and current. I will work with those that want to support more, although I anticipate it will just work. Many thanks to ru@, obrien@ and jhb@ for providing valuable input at various stage of implementation, as well as for working together to positively effect a change for the better. Notes: svn path=/head/; revision=113136
* Simplify compatibility ifdef.Warner Losh2003-04-041-4/+7
| | | | Notes: svn path=/head/; revision=113045
* xargs(1) is WARNS=6 clean.Maxime Henrion2003-03-281-1/+1
| | | | | | | Tested on: i386, sparc64 Notes: svn path=/head/; revision=112747
* When -o isn't specified, open /dev/null as stdin.Maxime Henrion2003-03-281-2/+5
| | | | | | | Suggested by: jhb Notes: svn path=/head/; revision=112746
* Add a new -o option to tell xargs(1) to reopen /dev/tty as stdin inMaxime Henrion2003-03-232-5/+21
| | | | | | | | | | | | | | | the child process, before executing the command. This is very useful when you do stuff like ``find ... | xargs interactive_application''. Without -o, the application would inherit the pipe as its stdin, and you thus lose any control over it. This flag has been carefully chosen to not conflit with other options of other xargs utilities like GNU xargs. Reviewed by: jmallett Notes: svn path=/head/; revision=112514
* Extend our -R extension which sets the number of arguments in which -I willJuli Mallett2003-02-262-3/+9
| | | | | | | | | | replace to support magic values less than zero, which mean to just go nuts and expand as many as we want. MFC after: 2 weeks Notes: svn path=/head/; revision=111581
* De-typo usage string.Juli Mallett2003-02-261-1/+1
| | | | Notes: svn path=/head/; revision=111580
* A few changes for clarity.Tom Rhodes2003-01-271-13/+17
| | | | | | | | PR: 47170 Submitted by: Gary W. Swearingen <swear@attbi.com> (original version) Notes: svn path=/head/; revision=109944
* english(4) police.Jens Schweikhardt2002-12-271-1/+1
| | | | Notes: svn path=/head/; revision=108317
* mdoc(7) police: most -mdoc macros can take multiple arguments.Ruslan Ermilov2002-12-231-2/+1
| | | | Notes: svn path=/head/; revision=108215
* Add the -P option which executes multiple copies of the specified utilityTim J. Robbins2002-12-212-19/+57
| | | | | | | in parallel. Idea from GNU xargs. Notes: svn path=/head/; revision=108156
* Take __FreeBSD_version into account when BOOTSTRAPPING.Ruslan Ermilov2002-11-132-9/+7
| | | | Notes: svn path=/head/; revision=106852
* Fix typos; each file has at least one s/seperat/separat/Jens Schweikhardt2002-08-111-2/+2
| | | | | | | | | | | | | (I skipped those in contrib/, gnu/ and crypto/) While I was at it, fixed a lot more found by ispell that I could identify with certainty to be errors. All of these were in comments or text, not in actual code. Suggested by: bde MFC after: 3 days Notes: svn path=/head/; revision=101677
* Declare environ as char **environ like in environ(7), not char *environ[].Tim J. Robbins2002-07-011-1/+1
| | | | | | | | | | | This corrects a problem whereby xargs could not walk the environment table to count the amount of space it used, and treated it as if it were empty. This problem was introduced in rev 1.15. MFC after: 2 days Notes: svn path=/head/; revision=99199
* Stylistic nit:Juli Mallett2002-06-221-5/+5
| | | | | | | | main()'s argv argument is char*[], and functions that may inherit that arg should use char*[] as well. Notes: svn path=/head/; revision=98617
* Check for results of repeated calls to strnsubst(), as well as for theJuli Mallett2002-06-221-6/+17
| | | | | | | behaviour with NULL match string, as that has changed over time. Notes: svn path=/head/; revision=98616
* When giving an example that relies on shell expansion/globbing, don't use aJuli Mallett2002-06-221-1/+1
| | | | | | | | | replstr for -J that will be interpereted by the shell. MFC after: 1 day Notes: svn path=/head/; revision=98614