summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2022-08-09Sort options, fix macro, add RCS Id.wiz
2022-08-08Add 4 new flags:kre
-b (from FreeBSD) - set blocksize to blocks (512 bytes) (overrides a contrary setting in BLOCKSIZE) -H (from FreeBSD and Linux): -h using SI units (powers of 10). Ugh. -N suppress the header line (except with -P which requires it). -f show only free space (or inodes) in a minimal format (implies -N) (that is, with one file[system] specified, print 1 number only) With -c, show only the total. Intended to be useful for scripting (aka, I needed it.) While here, improve the usage message (group options where they apply, there is no reason, for example, that -g should be shown differently to -k -m ..., and those options aren't at all useful with -G) Update the man page to match.
2022-08-07fix various typos in comments, documentation and messages.andvar
mainly s/paramater/parameter/ and s/reduntant/redundant/.
2022-08-07kill(1): s/proceses/processes/andvar
2022-07-18Fix bug revealed by SIGINFO support; Do not treat short read(2)/write(2)rin
as error (*). This occurs typically when signal is received. (*) For older version, we already deal with short read(2) from remote host in sink(). But for other cases, i.e., write(2) to local file in sink(), read(2)/write(2) in source(), error was raised. This version of rcp(1) can successfully send/receive files with older version, even if short read(2)/write(2) occurs by SIGINFO. Also, when real error occurs, give up immediately instead of continue to send/receive wrong data. Clean up the mess a little bit as well...
2022-07-09csh(1): fix punctuation at the end of an .Xr lineuwe
2022-07-03Fix core dump caused bykre
ksh -c '(i=10; echo $((++-+++i)))' reported by Steffen Nurpmeso (not on a NetBSD list or PR). Seems pointless to fix just one of the bugs in this thing, but this one was easy enough (and stupid enough). (The "i=10" part is unimportant, as is the sub-shell).
2022-06-26Add SIGINFO support. Mostly stolen from scan_ffs(8).rin
2022-05-31fix various typos in comments, documentation and messages.andvar
2022-05-28fix various typos, mainly in comments.andvar
2022-05-20fix some misspellings and remove trailing whitespaces.andvar
2022-05-16Alter error messages so they no longer claim that bad input is illegal.kre
2022-05-14Clarify that "stty 0" will normally hang up the tty. Bump date.dholland
2022-05-10date(1): Use .Dl for one-liners. Same output is generated.uwe
2022-05-10date(1): Fix the offset in previous.uwe
2022-05-10date(1): add example for how to get seconds since the Epoch outputwiz
2022-04-18Introduce a new macro JNUM to replace the idiom jp-jobtab+1kre
(the job number, given jp a pointer to a jobs table entry) used open coded previously in many places (mostly in DEBUG mode trace messages, so not included in most shells, but there are a few others). Make the type of JNUM() be int rather than the ptrdiff_t the open coded version became ... which when used in some printf() type function arg list was cast to some other arbitrary (but not consistent) int type for which there is a standard %Xd type format conversion. Now we can (and do) just use %d for this. If the number of jobs ever exceeds the range of an int, we would have far more serious problems than the broken output this would cause. While here improve a comment or two, and use JOBRUNNING instead of 0 where the intent is the former (JOBRUNNING is #defined as 0). NFCI.
2022-04-17fix various typos in comments.andvar
2022-04-16Redo the way the builtin cmd 'ulimit' getopt() (nextopt() really, but itkre
is essentially the same) arg string is generated, to lessen the chances that the table of limits, and the arg string that allows limits to be reported or set will get out of sync. They weren't (as long as we didn't grow an RLIMIT_SWAP) this is just tidier. While here, reorder the limits table fields, and shrink a couple that were needlessly wasteful, to save some space -- for most architectures this should save 8 bytes per table entry (there are currently 13). (Some minor code bloat offsets this slightly because of int type promotions now required). NFCI.
2022-04-16While doing the previous change, I noticed that when used in akre
particularly perverse way, the error message for a bad octal constant as the new umask value could incorrectly claim that the -S option (which would need to be present to cause this issue) was the detected bad value. Fix that to report the actual incorrect arg. And while fiddling, also check for args to umask that are too big to be sane mask values (the biggest permitted is 07777) and use mode_t as the mask variable type, rather than int.
2022-04-16Avoid generating error messages implying that user errors are illegal.kre
2022-04-10fix various typos in comments and output/log messages.andvar
2022-04-08fix various typos, mainly in comments, but also log messages, docs, game text.andvar
2022-02-08sh: fix typo in commentrillig
2022-02-02After (a few days short of) 21 years, revert 1.25, which did nothing exceptkre
make the -e option to "fc" fail to work (the commit message was about some other changes entirely, so I an only assume this was committed by mistake). It says a lot about the use of the fc command that no-one noticed that this did not work properly for all this time. Internally in sh, it is possible for built in commands to use either getopt(3) (from libc) or the much simpler internal shell nextopt() routine for option (flag) parsing. However it makes no sense to use getopt() and then access a global variable set only by nextopt() instead of the one getopt() sets (which is what the code had used previously, forever). Use the correct variable again. XXX pullup -9 -8 (-7 -6 -5 ...)
2022-01-31When we initialize libedit (editline) always call ourselves "sh" nokre
matter what $0 is (or is not) set to. This means that editrc(5) lines that start "sh:" are used (in addition to those with no prefix, which will usually be most of them), regardless of the name or manner in which we were invoked. OK christos@
2022-01-31Add some comments explaining accesses to the environment viakre
getenv()/setenv()/unsetenv() which manipulate the envornoment the shell was passed at entry. These are a little odd in sh as that environment is copied into the shell's internal variable data struct at shell startup, and normally never accessed after that - in builtin commands (test. printf, ...) getenv() is #defined to become an internal sh lookup function instead, so even those never use the startup environment). NFCI
2022-01-26remove double t from targeted, add missing r to arbitraryandvar
And fix few more typos along the way in comments and man pages.
2022-01-24s/begining/beginning/ in comments and messages.andvar
2022-01-22After 3 and a bit years, it is time...kre
2022-01-14update header too.christos
2022-01-14The "ibm" and "oldibm" tables are identical, because POSIX justchristos
standardised the table from V7. Nobody, including the original authors, seems to have noticed this. Merge them and update the documentation. Also fix the odd, inconsistent, spelling of "pre-4.3BSD-Reno"). (From nabijaczleweli)
2022-01-07sh(1): improve getopts docs for optstring leading :lukem
getopts has different behaviour if the leading character of optstring is `:', so describe in more detail: - no errors are printed (already there) - unknown options set var to `?' and OPTARG to the unknown option - missing arguments set var to `:' and OPTARG to the option name Slight rewording of other paragraphs for more clarity.
2022-01-07sh(1): fix formatting warningslukem
2022-01-05Use a volative local shadow of a field in an (on-stack) non-volatile structkre
that is to be referenced after a return from setjmp() via longjmp(). This doesn't ever seem to have caused a problem, but I think using volative vars is required here. For reasons I never bothered to discover, even though this change certainly requires a store into stack memory which wasn't required before, earlier measurements showed the shell getting (slightly) smaller with this change in place. NFCI
2021-12-19s/forground/foreground/ in comments.andvar
2021-12-19s/backgound/background/andvar
2021-12-12s/Miscelaneous/Miscellaneous/ and s/slahes/slashes/ in comments.andvar
2021-12-08s/desireable/desirable/ in comments.andvar
2021-12-05s/existance/existence/ in comment.msaitoh
2021-12-05s/commmand/command/ in comment.msaitoh
2021-12-05s/exisit/exist/ in comment.msaitoh
2021-11-29Set totals.f_frsize to DEV_BSIZE instead of totals.f_bsize so thatsimonb
addstat() uses an initialised value for total size calculations. Fixes core dump for "df -c".
2021-11-22PR bin/53550kre
Here we go again... One more time to redo how here docs are processed (it has been a few years since the last time!) This is actually a relatively minor change, mostly to timimg (to just when things happen). Now here docs are expanded at the same time the "filename" word in a redirect is expanded, rather than later when the heredoc was being sent to its process. This actually makes things more consistent - but does break one of the ATF tests which was testing that we were (effectively) internally inconsistent in this area. Not all shells agree on the context in which redirection expansions should happen, some make any side effects visible to the parent shell (the majority do) others do the redirection expansions in a subshell so any side effcts are lost. We used to have a foot in each camp, with the majority for everything but here docs, and the minority for here docs. Now we're all the way with LBJ ... (or something like that).
2021-11-21Improve the however-many-negatives wording even more.kre
2021-11-20sh.1: replace triple negation with single negation, fix typorillig
2021-11-20Improve the wording of the "Argument List Processing" section (wherekre
all the sh options, also used with "set", are listed) in response to a discussion on icb conveyed to me by Darrin B. Jewell. A few improvements to the description of the "set" built-in as well. Bump Dd to cover all of this month's changes (so far).
2021-11-16sh.1: fix typosrillig
2021-11-16echo: fix lint error due to strict bool moderillig
No functional change.
2021-11-16Make pwd (both /bin/pwd and the /bin/sh built-in version) check forkre
write errors on stdout, and indicate an error if that happens.