aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xargs
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Note that this appeared at least as early as PWB UNIX.Juli Mallett2002-06-101-0/+4
| | | | | | | Use the literal string 'PWB UNIX', as we still have no .At macro for it. Notes: svn path=/head/; revision=98107
* Err, duh, free(3) doesn't set its argument to NULL... Fix realloc of a freedJuli Mallett2002-06-041-1/+3
| | | | | | | chunk. Notes: svn path=/head/; revision=97794
* Restructure sanity checks so that -I and -J just override eachother, ratherJuli Mallett2002-05-301-5/+6
| | | | | | | | | | than triggering a usage(). Allow -R and -I to be specified in any order, and thus change how -R checks for -I not being given and triggering a usage(). Partially requested by: gad Notes: svn path=/head/; revision=97620
* Allow the input line to be NULL, and teach strnsubst() that NULL means to useJuli Mallett2002-05-302-3/+8
| | | | | | | a nil-string. Notes: svn path=/head/; revision=97619
* mdoc(7) police: punctuation, miscellaneous.Ruslan Ermilov2002-05-301-8/+8
| | | | Notes: svn path=/head/; revision=97549
* Simplify prerun() in the case where there are no arguments. Can't do -I or -JJuli Mallett2002-05-171-1/+1
| | | | | | | | substitution if `utility' is not specified and we're using the buildin echo; It has no arguments for us to abuse. Notes: svn path=/head/; revision=96797
* Fix a "tiny and squeeby and little" markup mistake.Juli Mallett2002-05-141-1/+1
| | | | | | | Submitted by: fenner Notes: svn path=/head/; revision=96619
* xargs.c,v 1.33 broke the upgrade path from old versions of 4.x and 5.0.Ruslan Ermilov2002-05-102-1/+13
| | | | Notes: svn path=/head/; revision=96351
* -I and -J both set the same variable, replstr, to the string to replace withJuli Mallett2002-05-061-0/+2
| | | | | | | | a line of input, and both work differently, so prevent them from both being passed to xargs(1). Notes: svn path=/head/; revision=96092
* Modify the -p implementation to use a user's locale, so they can respond toJuli Mallett2002-05-052-13/+63
| | | | | | | | | | | | | | | the prompt in their native language. Also make the prompt fit what POSIX asks for (?...). This should not affect use of -p with yes(1) [as every locale I know of matches 'y' as YESEXPR as well], but that's what -t is for anyway. -p is meant to be really used interactively. Submitted by: tjr, jmallett Notes: svn path=/head/; revision=96057
* Fix a typo.Juli Mallett2002-05-051-2/+3
| | | | | | | | | Submitted by: Carl Schmidt <cschmidt@slackerbsd.org> Wrap an obscenely long line while I'm here. Notes: svn path=/head/; revision=96055
* In an effort to make this utility easier to work with at a source level, moveJuli Mallett2002-05-051-139/+152
| | | | | | | | | | | | | | | | | out the parse loop to a seperate function, and move local variables around as is needed. To keep the state of some variables and keep from having huge arg lists to functions, make a bunch global. Change use of err(3) in situations where malloc(3) will be setting errno to errx(3) since assuming malloc(3) sets errno is non-portable, and provides no more useful information in the context of FreeBSD. Submitted by: bde (err/errx), Carl Schmidt <cschmidt@slackerbsd.org> (some of the movement of the input loop to a function) Approved by: src/tools/regression/usr.bin/xargs Notes: svn path=/head/; revision=96050
* Grouping changes.Juli Mallett2002-05-041-2/+2
| | | | | | | Submitted by: Carl Schmidt <cschmidt@slackerbsd.org> Notes: svn path=/head/; revision=96014
* Don't use pointers as booleans.Juli Mallett2002-05-041-3/+3
| | | | Notes: svn path=/head/; revision=96013
* Replace calloc(3) with malloc(3), and set the tail of theJuli Mallett2002-05-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument list to NULL, to terminate the arguments passed to execvp(2). Thanks to: bde (for pointing out some missing parens) And with apologies to Ozzy Osbourne: On his way to dinner It took him by surprise When an email from bde Said his code was full of lies Style (indentation) And his bracing were all wrong He casted to size_t When he should have cast to long I don't mind Single letter identifiers Unwrapped Line Over 80 chars Far over 80 chars Who can we get to send diffs We need Bruce D. Evans Shows you comparason to his We need Bruce D. Evans again Notes: svn path=/head/; revision=96006
* Fix a bug whereby we were getting ~0 and comparing it to maxsize, i.e. ifJuli Mallett2002-05-031-1/+1
| | | | | | | | | | s1 was 0 length, and replstr was 0 length, etc., we would end up subtracting one from zero and seeing if it was greater than the size_t (unsigned) var maxsize... This would cause us to return a string consisting of essentially only match, which is not the right behaviour if we have 0 length inpline. Notes: svn path=/head/; revision=95996
* Move substitution out to a function, prerun(), and replace use of run() withJuli Mallett2002-05-031-85/+78
| | | | | | | | | | it. It handles everything (right now) that needs done before run(), except the -J case, because while that would be easy, I don't quite understand -J. Reviewed by: src/tools/regression/usr.bin/xargs Notes: svn path=/head/; revision=95990
* Get rid of bogus holder for realloc(3).Juli Mallett2002-05-031-6/+5
| | | | Notes: svn path=/head/; revision=95987
* Rewrite the loop that handles substitution in the -I case, and try to makeJuli Mallett2002-05-031-15/+75
| | | | | | | | | | | | it easier to understand. Making it easy to understand isn't all that easy, so litter the code with comments so some other poor soul can come along some day and work on this if they see fit to do so. Avoid calling strlen(3) to check for a nil-string, when we can just check for *str=='\0'. Approved by: src/tools/regression/usr.bin/xargs/ Notes: svn path=/head/; revision=95986
* Rename `lflag' to `Lflag' to match the option's case.Juli Mallett2002-05-031-6/+6
| | | | Notes: svn path=/head/; revision=95985
* Revert revision 1.22. I incorrectly modified the Berkeley identifiers.Juli Mallett2002-05-031-3/+12
| | | | | | | Requested by: bde, mike Notes: svn path=/head/; revision=95983
* __COPYRIGHT() and __SCCSID().Juli Mallett2002-05-021-12/+3
| | | | Notes: svn path=/head/; revision=95917
* An explicit cast to size_t for an inline integer, since the two are not theJuli Mallett2002-05-021-2/+2
| | | | | | | | | | same on Alpha and lint(1) pointed that out. lint(1) on the same architecture pointed out how silly a cast to (u_int) to malloc(3)'s argument was. Change that to size_t. Notes: svn path=/head/; revision=95916
* A markup fix, and document -R as non-standard.Juli Mallett2002-05-021-3/+5
| | | | Notes: svn path=/head/; revision=95906
* Make -J a proper flag internal to the code (rather than just check forJuli Mallett2002-05-022-10/+30
| | | | | | | | | | | use of replstr and lack of Iflag), and add -R, which when given with -I controls the number of arguments on which replacement will be done. Some people happen to think it's idiotic to limit to 5 arguments, so let the user override it if they like. Notes: svn path=/head/; revision=95905
* *str is spelled 's1' inside the body of the code.Juli Mallett2002-05-021-4/+2
| | | | | | | | Make 'this' not a local variable, since it isn't necessary or complex enough to warrant such. Notes: svn path=/head/; revision=95900
* Rework some of the -I support so I can't find a way to make xargs(1) core orJuli Mallett2002-05-022-15/+14
| | | | | | | | | | | corrupt memory. Simplifies the code in one or two places, also removes some code that looks like it was bogus or incomplete. Update strnsubst to have one or two extra conditions which maybe would make it more efficient, or at least more versatile. This is likely a no-op. Notes: svn path=/head/; revision=95898
* In the case where we can't open /dev/tty, fall back to -t behaviour.Juli Mallett2002-04-191-9/+7
| | | | | | | Submitted by: fenner Notes: svn path=/head/; revision=95085
* Bump WARNS to 4.Juli Mallett2002-04-191-0/+1
| | | | Notes: svn path=/head/; revision=95084
* Compound two fprintf(3)s into 1 using string concatenation.Juli Mallett2002-04-191-2/+1
| | | | Notes: svn path=/head/; revision=95082
* After 3 months...Juli Mallett2002-04-194-44/+272
| | | | | | | | | | | | | | | | | | | | Merge xargs(1) with that of xMach. Bring in xargs(1) changes to add -L and -I as per the Single Unix Specification version 3. Proper exit status numbers are implemented, and the manual page has been updated to reflect reality. The code has been ANSIfied, and a new file has been added to xargs(1) to do the substring substitution as SUSv3 requires. Traditional behaviour should not be affected, use of -J should be deprecated in favor of the more portable -I (though -J has been left, for now). Submitted by: me, tjr (the exit status stuff) Obtained from: xMach Notes: svn path=/head/; revision=95080