summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* sh: Document the expansion changes in the man page.jilles2010-04-041-2/+20
| | | | | | | | Note that the following sentence > Enclosing the full parameter expansion string in double-quotes does not > cause the following four varieties of pattern characters to be quoted, > whereas quoting characters within the braces has this effect. is now true, but used to be incorrect.
* sh: Do tilde expansion in substitutions.jilles2010-04-031-3/+3
| | | | | | | | | | | | | This applies to word in ${v-word}, ${v+word}, ${v=word}, ${v?word} (which inherits quoting from the outside) and in ${v%word}, ${v%%word}, ${v#word}, ${v##word} (which does not inherit any quoting). In all cases tilde expansion is only attempted at the start of word, even if word contains spaces. This agrees with POSIX and other shells. This is the last part of the patch tested in the exp-run. Exp-run done by: erwin (with some other sh(1) changes)
* sh: Allow quoting pattern match characters in ${v%pat} and ${v#pat}.jilles2010-04-031-1/+3
| | | | | | | | Note that this depends on r206145 for allowing pattern match characters to have their special meaning inside a double-quoted expansion like "${v%pat}". PR: bin/117748 Exp-run done by: erwin (with some other sh(1) changes)
* sh: Remove special handling for ' and " in arithmetic.jilles2010-04-032-6/+1
| | | | | | | They will be treated like normal characters, resulting in a runtime arithmetic expression error. Exp-run done by: erwin (with some other sh(1) changes)
* sh: Fix various things about expansions:jilles2010-04-031-73/+208
| | | | | | | | | | | | | | | | | | | | * remove the backslash from \} inside double quotes inside +-=? substitutions, e.g. "${$+\}a}" * maintain separate double-quote state for ${v#...} and ${v%...}; single and double quotes are special inside, even in a double-quoted string or here document * keep track of correct order of substitutions and arithmetic This is different from dash's approach, which does not track individual double quotes in the parser, trying to fix this up during expansion. This treats single quotes inside "${v#...}" incorrectly, however. This is similar to NetBSD's approach (as submitted in PR bin/57554), but recognizes the difference between +-=? and #% substitutions hinted at in POSIX and is more refined for arithmetic expansion and here documents. PR: bin/57554 Exp-run done by: erwin (with some other sh(1) changes)
* sh: Treat unexpected newlines in substitutions as a syntax error.jilles2010-04-031-0/+4
| | | | | | | The old approach was wrong because PS2 was not used and seems unlikely to parse extensions (ksh93's ${ COMMAND} may well fail to parse). Exp-run done by: erwin (with some other sh(1) changes)
* Merge OpenBSD revisions 1.4 through 1.9, mostly style cleanups.delphij2010-03-301-8/+9
| | | | | Obtained from: OpenBSD MFC after: 3 month
* Remove unused files.delphij2010-03-303-617/+0
|
* Change all our own code to use st_*tim instead of st_*timespec.ed2010-03-284-41/+41
| | | | Also remove some local patches to diff(1) which are now unneeded.
* o) Add a keyword to displaying elapsed time in integer seconds, "etimes".jmallett2010-03-174-2/+25
| | | | | | o) Give slightly better (i.e. any) documentation of the format of "etime". Reviewed by: jilles
* sh: Do not abort on a redirection error on a compound command.jilles2010-03-141-4/+42
| | | | | | | | | | | | | | Redirection errors on subshells already did not abort the shell because the redirection is executed in the subshell. Other shells seem to agree that these redirection errors should not abort the shell. Also ensure that the redirections will be cleaned up properly in cases like command eval '{ shift x; } 2>/dev/null' Example: { echo bad; } </var/empty/x; echo good
* sh: Do not abort on a redirection error if there is no command word.jilles2010-03-131-1/+7
| | | | | | | | | | | Although simple commands without a command word (only assignments and/or redirections) are much like special builtins, POSIX and most shells seem to agree that redirection errors should not abort the shell in this case. Of course, the assignments persist and assignment errors are fatal. To get the old behaviour portably, use the ':' special builtin. To get the new behaviour portably, given that there are no assignments, use the 'true' regular builtin.
* sh: Fix longjmp clobber warnings in parser.c.jilles2010-03-131-166/+162
| | | | | | Make parsebackq a function instead of an emulated nested function. This puts the setjmp usage in a smaller function where it is easier to avoid bad optimizations.
* Switch to our preferred license text.joel2010-03-078-64/+64
| | | | Approved by: jedgar
* sh: Make sure to popredir() even if a function caused an error.jilles2010-03-061-1/+3
|
* sh: Make sure to popredir() even if a special builtin caused an error.jilles2010-03-061-2/+3
|
* sh: Improve the command builtin:jilles2010-03-064-43/+90
| | | | | | | | * avoid unnecessary fork * allow executing builtins via command * executing a special builtin via command removes its special properties Obtained from: NetBSD (parts)
* Update the list of the process flags. Note that the lists of pendingkib2010-03-051-3/+15
| | | | | | | signals for process and its threads are distinct. Reviewed by: jilles MFC after: 2 weeks
* ed(1): make WARNS=6 cleanuqs2010-03-042-7/+1
| | | | | | | | Although argc and argv are never read after the longjmp is complete, gcc is not clever enough to see that and needlessly warns about it. So add volatile to silence the compiler. Approved by: ed (the co-mentor, not ed(1))
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-022-14/+0
| | | | | | | their software. Approved by: pjd Obtained from: NetBSD
* Do not restrict the allowed signals that can be specified by numberkib2010-02-251-1/+1
| | | | | | | to the list of signals that has symbolic name. It was impossible to send rt signals with kill(1) due to the check. MFC after: 1 week
* Fix expansion of \W in prompt strings when the working directory is "/".jh2010-02-241-1/+1
| | | | | | | | The prompt string was truncated after \W when the working directory was "/". PR: bin/89410 Submitted by: Dr Balwinder Singh Dheeman MFC after: 1 week
* Bump WARNS where possible.uqs2010-02-151-1/+1
| | | | | Checked by: make universe Approved by: ed (co-mentor)
* - Implement -q option for pgrep(1).pjd2010-02-122-5/+20
| | | | - Add regression test to test -q option.
* Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This ↵brucec2010-02-082-2/+4
| | | | | | | | allows the -M option to be used without specifying -N. PR: bin/138146 Approved by: rrs (mentor) MFC after: 3 days
* Make sure that FTS_COMFOLLOW is not set when the -P option is in effect.jh2010-02-081-2/+6
| | | | | | | | | | Otherwise the -i option will show the inode number of the referenced file for symbolic links given on the command line. Similarly, the file color was printed according to the link target in colorized output. PR: bin/102394 Reviewed by: jilles MFC after: 2 weeks
* Tell the compiler these structures are aligned to a byte boundary.imp2010-02-073-7/+5
| | | | | | | | | | All the elements of these structs are char anyway, so it won't hurt performance. Bump warns back up to the default. # we likely should have CTASSERTS to make sure they are the right size. # but with libarchive based tar maybe we shouldn't bother.
* sh: Do not stat() $MAIL/$MAILPATH in non-interactive shells.jilles2010-02-062-1/+8
| | | | | These may be NFS mounted, and we should not touch them unless we are going to do something useful with the information.
* Arm doesn't seem to need such kit gloves. Bump the warnings to 3 hereimp2010-02-041-2/+0
| | | | as well.
* Fixes for ls(1) long format (-l) output:jh2010-01-243-21/+50
| | | | | | | | | | - Allow -h option to work if the listing contains at least one device file. - Align major and minor device numbers correctly to the size field. PR: bin/125678 Approved by: trasz (mentor) MFC after: 1 month
* Print full path in the error message. It's possible that fts(3)jh2010-01-241-1/+1
| | | | | | | | | | provides an empty fts_name and reporting the full path is more appropriate especially with the -R option. PR: bin/107515 Submitted by: bde Approved by: trasz (mentor) MFC after: 1 week
* Remove stale references to utmp(5) and its corresponding filenames.ed2010-01-211-2/+2
| | | | I removed utmp and its manpage, but not other manpages referring to it.
* Raise WARNS for various tools where possible.ed2010-01-171-1/+0
| | | | Submitted by: Marius Nünnerich <marius@nuenneri.ch>
* Implement an "-x" option to cp(1), for compatibility with Linux andgavin2010-01-173-7/+12
| | | | | | | | | | | | feature parity with du(1) and similar: When set, cp(1) will not traverse mount points. Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk PR: bin/88056 Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk Approved by: ed (mentor) MFC after: 1 month
* Port everything in bin/ from utmp to utmpx.ed2010-01-133-12/+3
| | | | | date: use libc utmpx routines instead of the ones provided by libulog. pax: don't depend on <utmp.h>
* Let csh(1) use utmpx instead of utmp.ed2010-01-132-5/+6
| | | | | | | | | csh allows you to monitor the utmp(x) file to monitor certain user logins. Unfortunately it needs to directly stat() this file. I don't want to break this module , but eventually it shouldn't do that. The idea of the getutxent(3) API is to hide file access. Approved by: mp
* Committed the wrong version in r201484. This time really fix the "-t"obrien2010-01-041-4/+14
| | | | | | functionality. Per the regression tests (pgrep-t.t & pkill-t.t), "-t" should accept "v1", which means a plain number should be accepted for UNIX98-style PTY's.
* Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t),obrien2010-01-041-3/+4
| | | | | "-t" should accept "v1", which means a plain number should be accepted for UNIX98-style PTY's.
* sh: Send the "not found" message for builtin <cmd> to redirected fd 2.jilles2010-01-031-5/+11
|
* sh: Fix some bugs with backquoted builtins:jilles2010-01-016-21/+23
| | | | | | | | | | | | - correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs output/errout in the code - treat all builtins as regular builtins so errors do not abort the shell and variable assignments do not persist - respect the caller's INTOFF Some bugs still exist: - expansion errors may still abort the shell - some side effects of expansions and builtins persist
* sh(1): document ulimit -w (swapuse rlimit).jilles2009-12-311-2/+5
| | | | MFC after: 1 week
* sh(1): Correct two places where "$@" lacked necessary quotes.jilles2009-12-311-2/+2
| | | | MFC after: 1 week
* sh: Use PATH= assignment in type.jilles2009-12-311-1/+1
| | | | | Example: PATH=/var/empty; PATH=/bin type ls
* sh: Allow command -pv and command -pV (lookup using _PATH_STDPATH).jilles2009-12-313-7/+14
|
* sh: Ensure funcnest is decremented if there was an error in the function.jilles2009-12-301-2/+3
| | | | | | This will be important when things like 'command eval f' will be possible. Currently, the funcnest = 0 assignment in RESET (called when returning to the top level after an error in interactive mode) is really sufficient.
* Fix memory leak when parsing backticks (``).jilles2009-12-301-13/+23
|
* sh: arith: Return only 0 and 1 from && and ||.jilles2009-12-301-2/+2
| | | | This agrees with C, POSIX and other shells.
* Add missing `void' for function without arguments.ed2009-12-291-1/+1
|
* Add missing `void' for function without arguments.ed2009-12-291-1/+1
|
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-281-8/+8
| | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month
OpenPOWER on IntegriCloud