aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/env
Commit message (Collapse)AuthorAgeFilesLines
* Update the date on the man-page to reflect the date that the '-u name'Garance A Drosehn2008-05-061-1/+1
| | | | | | | change was committed, instead of when I had first started writing it... Notes: svn path=/head/; revision=178811
* Add the '-u name' option to the env command, which will completely unsetGarance A Drosehn2008-04-172-8/+31
| | | | | | | | | | | the given variable name (removing it from the environment, instead of just setting it to a null value). PR: bin/65649 MFC after: 2 weeks Notes: svn path=/head/; revision=178289
* Significantly reduce the memory leak as noted in BUGS section forSean Farley2007-07-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171195
* Back out all POSIXified *env() changes.Andrey A. Chernov2007-05-011-3/+3
| | | | | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs. Notes: svn path=/head/; revision=169177
* env calls setenv("name=value", "value", 1); which violates POSIX:Andrey A. Chernov2007-04-301-3/+3
| | | | | | | | | | "The setenv( ) function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character." The fix (like all others in this subject) is backward-compatible. Notes: svn path=/head/; revision=169145
* Fix minor memory leak when expanding ${variable}sGarance A Drosehn2005-07-181-1/+5
| | | | | | | | Noticed by: Dave Hart MFC plans: after checking with re@ Notes: svn path=/head/; revision=148142
* Fix two minor parsing bugs in -S processing:Garance A Drosehn2005-07-131-14/+23
| | | | | | | | | | | | | | 1) An unquoted space is always a separator, even when not "in_arg". 2) When a new destination buffer must be allocated during variable substitution, only copy data from the active buffer to the new one when we *are* "in_arg". These were noticed when testing variable-substitution of variables which have null values, and are not inside quoted strings... MFC plans: after a few days, and re@ approval... Notes: svn path=/head/; revision=147971
* Tidy up the markup.Ruslan Ermilov2005-06-221-33/+48
| | | | | | | | Approved by: re (blanket) OK'ed by: gad Notes: svn path=/head/; revision=147532
* Fix a bug where the value of ${SOMEVAR} would simply disappear if thereGarance A Drosehn2005-06-211-23/+48
| | | | | | | | | | | was a separator character immediately before it. This wasn't likely to happen in #-lines, but we might as well get it right. Also fix it so that "" and "" will create a zero-length argument. Approved by: re (blanket `env') Notes: svn path=/head/; revision=147521
* Put in a more descriptive heading for the `env' command.Garance A Drosehn2005-06-211-1/+1
| | | | | | | | Noticed by: Matthew D Fuller Approved by: re (blanket `env') Notes: svn path=/head/; revision=147518
* Undo r1.14 to env.c. While it is unusual for environment variables toGarance A Drosehn2005-06-212-7/+2
| | | | | | | | | | | start with a '/', they are more supported (by POSIX and SUSv3) than filenames which have an '=' in them. Noticed by: tjr Approved by: re (blanket `env') Notes: svn path=/head/; revision=147517
* Add the '-S' and '-P' options. The '-S' option can be used to splitGarance A Drosehn2005-06-205-32/+829
| | | | | | | | | | | | | | | | | apart a string, and supports some text substitutions. This can be used to provide all the flexibility (and more!) that was lost by recent changes to how the kernel parses #!-lines in shell scripts. The '-P' option provides a way to specify an alternate set of directories to use when searching for the 'utility' program to run. This way you can be sure what directories are used for that search, without changing the value of PATH that the user has set. Note that on FreeBSD 6.0, this option is worthless unless the '-S' option is also used. Approved by: re (blanket `env') Notes: svn path=/head/; revision=147493
* If the `utility' specified starts with a '/' character, then execute itGarance A Drosehn2005-06-201-1/+2
| | | | | | | | | | without checking it for an equals-sign. If it starts with a slash, then it cannot be a request to set the value of a valid environment variable. Approved by: re (blanket `env') Notes: svn path=/head/; revision=147492
* Move the code that clears the environment when `-i' is specified, so it thatGarance A Drosehn2005-06-201-5/+9
| | | | | | | | | | it does not happen until all single-letter options are processed. This will be important for the -S option, which will be coming soon. Approved by: re (blanket `env') Notes: svn path=/head/; revision=147491
* Add a '-v' option to `env', to make it easier to discover exactly what stepsGarance A Drosehn2005-06-201-4/+25
| | | | | | | | | | it is doing, and what order it does them. This will be much more useful as more options are added. Approved by: re (blanket `env') Notes: svn path=/head/; revision=147490
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Language and markup polishing.Ruslan Ermilov2004-05-191-11/+14
| | | | Notes: svn path=/head/; revision=129436
* Fix grammar bogon.Jens Schweikhardt2004-02-291-1/+1
| | | | Notes: svn path=/head/; revision=126402
* Removed (after the env(1)/printenv(1) split) extraneous argumentsRuslan Ermilov2003-11-021-9/+9
| | | | | | | to the .Nm macro. Notes: svn path=/head/; revision=121909
* Split the env(1) manpage off from printenv(1); there is not much pointTim J. Robbins2003-06-012-1/+144
| | | | | | | in keeping them together. Mention that printenv is obsolescent. Notes: svn path=/head/; revision=115603
* ANSIify function definitions.David Malone2002-09-041-4/+2
| | | | | | | | | | | | Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5 Notes: svn path=/head/; revision=102944
* Discourage use of env(1)'s "-" flag by moving its description to theTim J. Robbins2002-06-281-1/+1
| | | | | | | Compatibility section of the manual page. Notes: svn path=/head/; revision=98968
* Indicate that env(1) allows you to supply arguments to the utility itTim J. Robbins2002-06-191-1/+1
| | | | | | | | | | | | | executes in the usage() message and manual page. Use "utility" instead of "command" in both places to emphasise that shell builtins etc. will not work, and to be consistent with the terminology used by POSIX. PR: 39210 Submitted by: Danny J. Zerkel <dzerkel@columbus.rr.com> MFC after: 1 week Notes: svn path=/head/; revision=98418
* remove __PWarner Losh2002-03-221-1/+1
| | | | Notes: svn path=/head/; revision=92920
* Leave the `copyright' variable exposed, since the main purpose of itMike Barcroft2002-03-071-2/+2
| | | | | | | | | is to put a copyright in the object file. Submitted by: bde Notes: svn path=/head/; revision=91792
* Use new ID scheme.Mike Barcroft2002-02-211-3/+9
| | | | | | | | | | Fix env(1)'s exit status to conform with SUSv3. Submitted by: Tim Robbins <tim@robbins.dropbear.id.au> MFC after: 2 weeks Notes: svn path=/head/; revision=91004
* Remove leaf node WARNS?=2 (that mainly I added). This shouldMark Murray2002-02-081-1/+0
| | | | | | | help the GCC3 transition and CURRENT in general. Notes: svn path=/head/; revision=90415
* Set WARNS=2 on programs that compile cleanly with it; add $FreeBSD$Dima Dorfman2001-06-301-2/+3
| | | | | | | | | where necessary. Submitted by: Mike Barcroft <mike@q9media.com> Notes: svn path=/head/; revision=79011
* Add ``-i'' option, which is the same as ``-''. The -i option is theSheldon Hearn1999-08-271-2/+3
| | | | | | | | | | | | recommended option in the manpage, but the - option remains for backward compatibility and is documented as such. PR: 13363 Reported by: James Howard <howardjp@wam.umd.edu> Reviewed by: bde Notes: svn path=/head/; revision=50444
* Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).Archie Cobbs1998-12-062-2/+3
| | | | Notes: svn path=/head/; revision=41568
* Add usage().Philippe Charnier1997-06-301-3/+11
| | | | Notes: svn path=/head/; revision=27100
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-291-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24360
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-272-0/+88
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590