aboutsummaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* date: attempt to more accurately describe year limitations with -vKyle Evans2022-06-281-2/+10
| | | | | | | | | | | The previous description was both incorrect and incomplete in its description -- the 2038 limit doesn't apply on !i386 platforms, and it didn't note that values above 100 are accepted and interpreted differently. Further, it didn't note that absolute years are accepted. Reviewed by: pauamma_gundo.com (manpages) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35360
* sleep.1: Fix mdoc styleMateusz Piotrowski2022-05-251-6/+7
| | | | | Fixes: be038c3afcae bin/sleep: add support for multiple delay values MFC after: 1 week
* stty: Remove stray '-'.Warner Losh2022-05-241-2/+2
| | | | | | | | There's a stray '-' that causes Fl to double the dash, but that's not how the command works. MFC After: 2 days Sponsored by: Netflix
* bin/sleep: document more non-standard featuresStefan Eßer2022-05-241-3/+4
| | | | | | | Add support of other time units than seconds to the IMPLEMENTATION NOTES section of the man page. MFC after: 1 week
* bin/sleep: add support for multiple delay valuesStefan Eßer2022-05-242-26/+40
| | | | | | | | | The sleep time is calculated as the sum of all arguments passed. This makes the FreeBSD version of sleep functionally compatible with the version in GNU coreutils. MFC after: 1 week
* bin/sleep: add support for units other than secondsA. Mallory2022-05-242-5/+25
| | | | | | | | | | | | | | | | The coreutils version of this command accepts a unit designation of s, m, h, or d (for seconds, minutes, hours, days) immediately following the number of (fractional) units to delay. The submitted patch has been modified in one detail: the test meant to detect the presence of the unit modified was not specific (!= 1) and would have accepted a non-numeric initial element or extra characters following the union. The committed version accepts only the number immediately followed by one of the defined unit designators and no further characters. PR: 264162 MFC after: 1 week
* pax(1): Remove a few double words in source code commentsGordon Bergling2022-04-091-4/+4
| | | | | | - s/an an/an/ MFC after: 3 days
* cp: fix -R recursion detectionKyle Evans2022-04-062-42/+57
| | | | | | | | | | | | | | | | | | | | | | The correct logic is a lot simpler than the previous iteration. We record the base fts_name to avoid having to worry about whether we needed the root symlink name or not (as applicable), then we can simply shift all of that logic to after path translation to make it less fragile. If we're copying to DNE, then we'll have swapped out the NULL root_stat pointer and then attempted to recurse on it. The previously nonexistent directory shouldn't exist at all in the new structure, so just back out from that tree entirely and move on. The tests have been amended to indicate our expectations better with subdirectory recursion. If we copy A to A/B, then we expect to copy everything from A/B/* into A/B/A/B, with exception to the A that we create in A/B. Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D34655
* Correct source markup. No change to output.Greg Lehey2022-03-301-8/+8
| | | | Reported by: 0mp@
* Remove reference to kernel clock time zone.Greg Lehey2022-03-301-2/+8
| | | | | | Add references. Reported by: philip@
* sh: fix autocompletion for commands that share name with a directoryPiotr Pawel Stefaniak2022-03-281-2/+33
| | | | | | | | | | Provide libedit a special function making it always add a space after the autocompleted command. The default one adds a slash if the word is also a name of a directory in the current working directory, but this is wrong for commands. Reviewed by: bapt, jilles Differential Revision: https://reviews.freebsd.org/D34544
* Describe modern time zone handling.Greg Lehey2022-03-281-11/+83
| | | | | Reviewed by: peterj@ MFC after: 2 weeks
* ps(1): Use calloc instead of malloc and memset.Alfonso2022-03-111-2/+1
| | | | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/546 MFC after: 1 week Sponsored by: NVIDIA Networking
* df: do not report a 100% full inode usage on fs without inodesBaptiste Daroussin2022-03-112-4/+10
| | | | | | | | | | | | | | | | Before: devfs 2 2 0 100% 0 0 100% /dev After: devfs 2 2 0 100% 0 0 - /dev The previous behaviour was confusing for end users and many monitoring tools Note the linux df tools is also using the same syntax '-' for such filesystem MFC After: 2 weeks Reviewed by: manu, emaste, imp Differential Revision: https://reviews.freebsd.org/D34515
* cp: Make -P work without -R as per POSIXCameron Katri2022-02-233-9/+31
| | | | | | | | | | According to POSIX, cp should allow the `-P` flag to work whether `-R` is specified or not. Currently, the `-P` option only works along with `-R`. PR: 199466 Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D30012
* cp: fix -R with linksKyle Evans2022-02-222-4/+83
| | | | | | | | | | The traversal was previously not properly honoring -H/-L/-P. Notably, we should not have been resolving symlinks encountered during traversal when either -H or -P are specified. Sponsored by: Klara, Inc. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D34063
* bin/df: allow -t option to be used together with -lStefan Eßer2022-02-103-28/+103
| | | | | | | | | | | | | | | | | | | | The df command provides a -l option to exclude all non-local file systems and a -t option with a (positive or negative) list of file system types to display. This commit adds support for a combination of -l and -t. If both are specified, the parameter list of the -t option is applied on top of the selection of öocal file systems (independently of the order of the -l and -t options). E.g., "df -t noprocfs,sysfs -l" will select all local file systems except those of type procfs and sysfs. PR: 260921 Approved by: imp Relnotes: yes MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33748
* cp: fix some cases with infinite recursionKyle Evans2022-01-272-5/+147
| | | | | | | | | | | | | | | | | | | | | | As noted in the PR, cp -R has some surprising behavior. Typically, when you `cp -R foo bar` where both foo and bar exist, foo is cleanly copied to foo/bar. When you `cp -R foo foo` (where foo clearly exists), cp(1) goes a little off the rails as it creates foo/foo, then discovers that and creates foo/foo/foo, so on and so forth, until it eventually fails. POSIX doesn't seem to disallow this behavior, but it isn't very useful. GNU cp(1) will detect the recursion and squash it, but emit a message in the process that it has done so. This change seemingly follows the GNU behavior, but it currently doesn't warn about the situation -- the author feels that the final product is about what one might expect from doing this and thus, doesn't need a warning. The author doesn't feel strongly about this. PR: 235438 Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D33944
* sh: Don't add something to a null pointerJilles Tjoelker2022-01-261-0/+2
| | | | | | | | | | | Pointer arithmetic on a null pointer is undefined behavior. The bug can be reproduced by running bin/sh/tests/builtins/wait6.0 with UBSAN. Reported by: Mark Millard Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34011
* pkgbase: Create a FreeBSD-csh packageEmmanuel Vadot2021-12-211-1/+4
| | | | | | | | | | Now that root uses /bin/sh as the default shell no need to have csh part of runtime. Put it in its own package. MFC after: never Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33471
* pkgbase: Put yellow pages programs to its own packageEmmanuel Vadot2021-12-211-1/+1
| | | | | | | | | YP is less and less used, split them to users have the choice to not install them. MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33441
* sh: Avoid some headers when NO_HISTORY is set.Bryan Drewery2021-11-252-0/+4
| | | | | | This is more simpler compatibility with using this source on older systems before libedit was made to install filecomplete.h in commit b315a7296d2.
* echo(1): Replace errexit() with err(3)Hans Petter Selasky2021-11-091-20/+2
| | | | | | | Differential revision: https://reviews.freebsd.org/D32501 Submitted by: christos@ MFC after: 1 week Sponsored by: NVIDIA Networking
* date: Capitalize seconds string in synopsesMateusz Piotrowski2021-11-032-4/+4
| | | | | | | | This makes it consistent with other date(1) implementations. Also, it feels more consistent since hours and minutes are already represented as HH and MM respectively. MFC after: 3 days
* date: Clean up synopsesMateusz Piotrowski2021-11-032-17/+38
| | | | MFC after: 3 days
* date.1: Fix some style issues and examplesMateusz Piotrowski2021-11-031-22/+27
| | | | | | | | | | | | | | | - Use Cm instead of Ar or Sq for command modifiers of the -v flag. - Remove unnecessary "Ar ..." from the synopsis. It's not clear what it was referring to. - Add missing arguments to the -f and -v flags. - Stylize the dot before "ss" with Cm in the default format in the -f flag description. - Set LC_ALL=C in the last example so that the output format of date(1) always matches the specified format of the -f flag not matter the locale. - List the -f flag as optional in all usage lines in the synopsis. MFC after: 3 days
* sh: Fix heredoc at certain places in case and forJilles Tjoelker2021-10-275-7/+37
| | | | | | | | After an unescaped newline, there may be a here-document. Some places in case and for did not check for one. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D32628
* sh: Set PATH envvar after setting HOME in dotfileKa Ho Ng2021-10-261-2/+2
| | | | | | | | | | | | In single-user mode, all env vars are absent, so exptilde() would not be able to expand ~ correctly. Place the lines setting PATH below HOME, so exptilde() would work as expected. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: jilles, emaste Differential Revision: https://reviews.freebsd.org/D27003
* sh(1): fix home/del key on mobaxterm envBaptiste Daroussin2021-10-201-0/+4
| | | | | | | | | | For $reason mobaxterm default on sending unusual sequence from home/del key, which makes libedit unabel to catch them and bind them correctly. mobaxterm seems popular on the windows environment, so add proper keybinding to default shrc configuration so it works out of box. Reported by: lme
* sh(1): interactive mode improvementBaptiste Daroussin2021-10-201-0/+9
| | | | | | | | | In the default configuration add 2 bindings which has been requested by many during the HEADSUP discussion: * csh like arrow history navigation * ctrl-arrow to jump from word to words Add an alias to make the history command exist as an alias to fc -l.
* src/bin/ps: Fix spelling errorElyes HAOUAS2021-10-021-1/+1
| | | | | | | Spell interruptible correctly. Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* src/bin/pax: Fix spelling errorElyes HAOUAS2021-10-021-1/+1
| | | | | | | "whats" -> "what's" Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* src/bin/mkdir: Spell occur correctly.Elyes HAOUAS2021-10-021-1/+1
| | | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* src/bin/sh: Fix spelling errorsElyes HAOUAS2021-10-024-4/+4
| | | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/544 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* freebsd-version(1): Add -j flag to support jailsFaraz Vahedi2021-10-012-5/+37
| | | | | | | | | | Make freebsd-version(1) support jails by adding the -j flag which takes a jail jid or name as an argument. As with other options, -j flags stack and display in the order requested. Reviewed by: bcr (manpages), kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25705
* hostname: avoid strcpy() overlap in -d flag handlingKyle Evans2021-09-251-3/+4
| | | | | | | We don't need the strcpy() anyways, just use a pointer to the hostname buffer and move it forward for `hostname -d`. Sponsored by: Klara, Inc.
* ps: fix `ps -aa`Math Ieu2021-09-241-6/+1
| | | | | | Passing the -a flag multiple times made ps show no processes. Differential Revision: https://reviews.freebsd.org/D27215
* read builtin: Empty variables on timeoutBryan Drewery2021-09-244-0/+29
| | | | | | | | This matches how a non-timeout error is handled. Reviewed by: jilles MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31876
* sh: Add -o verify to use O_VERIFY when sourcing scriptsStephane Rochoy2021-09-239-12/+31
| | | | | | | | | | | | Add -o verify to sh to make it use O_VERIFY when sourcing scripts and reading profiles. Useful in conjunction with mac_veriexec to help protect at least some parts of the boot sequence, e.g., /etc/rc*. Differential revision: https://reviews.freebsd.org/D30464 Reviewed by: jilles, sjg Obtained from: Stormshield
* sh: try to avoid overwriting HISTFILE produced by other shellsPiotr Pawel Stefaniak2021-09-221-2/+6
| | | | | If an attempt to load history from an existing history file was unsuccessful, do not try to save command history to that file on exit.
* sh: improve command completionPiotr Pawel Stefaniak2021-09-221-4/+18
| | | | | | | | When there are many matches, find the longest common substring starting from the beginning of each command and use that to replace input. As an example: on my system, llv<tab> will be autocompleted to llvm- and another <tab> will print all matching llvm commands.
* sh: reset sh bindings on bind -e, bind -vPiotr Pawel Stefaniak2021-09-221-0/+7
| | | | | | | | | Until this change, any bindings set in histedit() were lost on calls to bindcmd(). Only bind -e and bind -v call libedit's keymacro_reset(). Currently you cannot fool libedit/map.c:map_bind() by trying something like bind -le as when p[0] == '-', it does a switch statement on p[1].
* sh: remove emacs improvements that are now defaults in libeditBaptiste Daroussin2021-09-221-2/+0
|
* ls(1): Allow LSCOLORS to specify an underlineCameron Katri2021-09-194-13/+30
| | | | | | | | Allows capitalizing the background color character to enable an underline instead of bold, capitalizing the foreground color char will still do bold. Differential Revision: https://reviews.freebsd.org/D30547
* sh: improve command completionPiotr Pawel Stefaniak2021-09-191-21/+19
| | | | | | | | | | When multiple matches are found, we keep the provided string on the input line and print unique matches as suggestions. But the multiple matches might be the same command found in different directories, so we should deduplicate the matches first and then decide whether to autocomplete the command or not, based on the number of unique matches.
* sh: improve emacs modeBaptiste Daroussin2021-08-281-0/+1
| | | | | | | | | in emacs mode ^W should delete the previous word by default Note that upstreaming this change directly into libedit is in process. Reported by: manu Reviewed by: jills, pstef, manu Differential Revision: https://reviews.freebsd.org/D29493
* Fix build of bin/getfacl after libc changes.Gleb Popov2021-08-271-92/+1
| | | | | | Reviewed by: kib, debdrup, gbe Approved by: kib Differential Revision: https://reviews.freebsd.org/D28255
* ls: prevent no-color build from complaining when COLORTERM is non-emptyPiotr Pawel Stefaniak2021-08-191-5/+3
| | | | | | | | | | | | | | | As 257886 reports, if ls(1) is built with WITHOUT_LS_COLORS="YES", it issues a warning whenever COLORTERM is non-empty. The warning is not useful, so I thought to remove it, but as Ed pointed out, we may want to have a way to determine whether a particular copy of ls has been compiled with color support or not. Therefore move the warnx() call to the getopt loop in a WITHOUT_LS_COLORS build to fire when the user asks for colored output. PR: 257886 Reported by: Marko Turk Reviewed by: kevans
* sh: fix NO_HISTORY buildPiotr Pawel Stefaniak2021-08-191-21/+21
| | | | | | | | Move code added in b315a7296d2a ("autocomplete commands") to conditionally compiled part under #ifndef NO_HISTORY. Reported by: bdrewery Fixes: b315a7296d2a
* df: remove the unused fstype varMateusz Guzik2021-07-201-3/+0
| | | | | | Found with cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate")