aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/env
Commit message (Collapse)AuthorAgeFilesLines
* Improve reliability of stdout tests.Dag-Erling Smørgrav2024-11-141-0/+1
| | | | | | | | | | | If the test runner is under heavy load, the command we are testing may succeed in printing to stdout before the dummy receiver has terminated. Add a short delay to reduce the likelihood of this happening. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47572
* Update Makefile.depend filesSimon J. Gerraty2024-10-141-0/+10
| | | | | | | After building packages we have a number of new and updated Makefile.depend files Reviewed by: stevek
* env: Check the status of stdout.Dag-Erling Smørgrav2024-10-082-0/+19
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47009
* env: Add an option to change the directory.Dag-Erling Smørgrav2024-10-083-8/+54
| | | | | | | | | | | This mirrors the equivalent option in GNU coreutils env, but does not add support for long options. MFC after: 3 days Relnotes: yes Sponsored by: Klara, Inc. Reviewed by: 0mp, bcr Differential Revision: https://reviews.freebsd.org/D47008
* env: Improve documentation.Dag-Erling Smørgrav2024-10-072-9/+39
| | | | | | | | | | | | | | | | | | * The `env` utility's inability to run a command whose name contains an equal sign is a feature, not a bug, so move that paragraph up from the BUGS section to the DESCRIPTION section. * Mention that this can be worked around by prefixing the command name with `command`, and add an example of this to the EXAMPLE section. * Add a test case which verifies that `env` does not run a command with an equal sign in its name even if it exists, and also demonstrates the workaround. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46997
* env: Add a handful of test cases.Dag-Erling Smørgrav2024-10-073-0/+111
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46996
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-10/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-273-6/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* pkgbase: Put more binaries/lib in runtimeEmmanuel Vadot2021-12-211-0/+1
| | | | | | | | | Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime. This is everything needed to boot to multiuser with FreeBSD-rc installed. MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33435
* env: style(9) fix, add a spaceKyle Evans2021-03-031-1/+1
| | | | | Reported by: pstef Fixes: 55deb0a5f089 ("service(8): use an environment more [...]")
* service(8): use an environment more consistent with init(8)Andrew Gierth2021-03-032-10/+22
| | | | | | | | | | | | | | | init(8) sets the "daemon" login class without specifying a pw entry (so no substitutions are done on the variables). service(8)'s use of env -L had the effect of specifying root's pw entry, with two effects: getpwnam and getpwuid are being called, which may not be entirely safe depending on what nsswitch is up to and what stage of boot we are at, and substitutions would have been done. Fix by teaching env(8) to allow -L -/classname to set the class environment with no pw entry at all specified, and use it in service(8). PR: 253959
* Document in the synopsis that -0 cannot be used with the utility argumentMateusz Piotrowski2020-11-111-2/+7
| | | | Notes: svn path=/head/; revision=367592
* Fix invalid use of macros and two typosMateusz Piotrowski2020-04-241-4/+4
| | | | | | | | | | | | It turns out that currently mandoc(1) is not handling Fl in Ss correctly (maybe it never was). Let's just replace "Fl S \&Ss ..." with "-S ...". After all, this subsection title is stylized anyway, so Fl is not that helpful. MFC after: 2 weeks Notes: svn path=/head/; revision=360283
* env(1): grow -L user/class and -U user/class optionsKyle Evans2020-02-053-5/+100
| | | | | | | | | | | | | | | This allows one to set the environment of the specified user either from login.conf alone (-L) or both login.conf and ~/.login_conf if present (-U). This is a supporting feature to allow service(8) to pull in the environment of the "daemon" class before invoking the rc script. This is a part of D21481. Submitted by: Andrew Gierth < andrew_tao173.riddles.org.uk> Notes: svn path=/head/; revision=357563
* Add -0 option to ENV(1)Joseph Mingrone2019-11-072-9/+32
| | | | | | | | | | | | With the -0 option added to ENV(1), some ports will no longer require genv from sysutils/coreutils. Reviewed by: kevans (prior version), swills Approved by: bcr (manpages), imp Differential Revision: https://reviews.freebsd.org/D22230 Notes: svn path=/head/; revision=354450
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Escape Ss to avoid confusion by mdoc parser with the Ss macroBaptiste Daroussin2017-02-111-1/+1
| | | | | | | | Reported by: make manlint MFC after: 2 days Notes: svn path=/head/; revision=313661
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+2
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | env: Fix crash when -S string is not empty but no operand follows.Jilles Tjoelker2015-03-081-2/+2
|/ | | | | | | | | | | | | | | split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769 MFC after: 1 week Notes: svn path=/head/; revision=279779
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | 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
* 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
* 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-34/+49
| | | | | | | | 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