summaryrefslogtreecommitdiffstats
path: root/bin/sh
Commit message (Collapse)AuthorAgeFilesLines
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-1468-68/+68
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix a problem that caused some foreground pipelines to die with:steve1997-01-061-3/+2
| | | | | | tcsetpgrp failed, errno=1 Discovered and Reviewed by: joerg
* Make sh(1) think and be in the same place at the same time. This closessteve1997-01-041-15/+11
| | | | PR#2331: strange output of sh's pwd on symlinked directories.
* With these changes sh(1)'s trap command should be POSIX-compliant,steve1996-12-241-49/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | while remaining (becoming :) compatible with other popular shells. Specifically these changes include: 1) Implement 'trap -l' to get a list of valid signals names. This is useful if you wanted to do something like reset all signal handlers to there defaults values, in which case something like this will do the trick. trap `trap -l` 2) Reformat the output of 'trap' so it can be saved and later eval'd to restore the saved settings. 3) Allow the use of signal names as well as signal numbers. 4) Fix trap handling of SIGCHLD so that commands like the following (albeit, contrived) won't cause sh(1) to recurse ad infinitum. trap uname 0 20 5) Make variables static that are used only in trap.c. 6) Minor 'style(9) police' mods.
* Oops, it needs little more caulk to get it right.steve1996-12-231-2/+2
|
* Apply a little dab of bit caulk to keep those beggarssteve1996-12-231-6/+2
| | | | | | from leaking out. Noticed by: bde
* Don't use _POSIX_PATH_MAX to limit the size of the path, insteadsteve1996-12-231-3/+3
| | | | | | use 'getcwd(NULL, 0)' just as pwd(1) does. Suggested by: bde
* Make sh(1) a little braver in the face of adversity. sh(1)steve1996-12-214-169/+21
| | | | | | | now handles the getpwd() init problem the same way as bash and ksh do. Also while I was in here, I cleaned up the format a little, removed some unnnecessary #if SYMLINKS cruft, and changed the pwd builtin to use getcwd(3) as Joerg suggested.
* This doesn't change any behavior, but may be a slightsteve1996-12-211-2/+2
| | | | | | optimization. (num-- > 0) --> (--num >= 0). Obtained from: NetBSD
* Remove extra #undef.steve1996-12-211-2/+1
|
* Fix a problem caused by finger failure on my part. The builtinsteve1996-12-211-3/+7
| | | | | | | | getopts should now work as expected. This fix was in the NetBSD code that I was merging from but missed getting into FreeBSD's version because of 'drain bamage' on my part. Submitted by: NetBSD, joerg
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-1443-491/+908
| | | | Obtained from: NetBSD, me
* Back out rev 1.7 which was to fix PR#1206 (to be reopened).peter1996-11-121-19/+2
| | | | | | | | | | This patch causes too many side effects, one of which bites hard is when interrupting a 'make fetch' in the ports tree (PR#1990). This whole area is a real can of worms.... This most definately should go into 2.2 Reviewed by: steve, bde
* 1) define STATIC as static and not emptyache1996-10-312-4/+22
| | | | 2) replace collate_range_cmp call with its code
* Add the -p (privileged) commandline switchsteve1996-10-294-8/+31
| | | | | | found in bash, zsh, and friends. Reviewed by: joerg
* Build intermediate object files for mkinit, mknodes and mksyntaxbde1996-10-251-6/+19
| | | | | | | | so that simple regresssion tests based on `cmp' work. mkdep still doesn't work right for these tools. They should probably be in separate directories. Sorted dependencies.
* Close PR# 1206. sh(1) now ignores SIGINT and SIGQUITsteve1996-10-221-3/+19
| | | | | | | when a child is forked and the -c commandline switch has been specified. Reviewed by: joerg
* Benign | --> || correction.steve1996-10-161-2/+2
|
* Fix a problem with sh that conflicts with the -esteve1996-10-061-2/+5
| | | | | | | | | flag text in the man page. Now this will work correctly: /bin/sh -ec 'false && true; echo hi' Obtained from: VaX#n8 <vax@linkdead.paranoia.com>
* re-activate the printf builtin now that src/usr.bin/printf.c has beenpeter1996-10-011-2/+2
| | | | | tweaked to work as a builtin better (ie: calls the real printf formatting code, not sh's cut-down out1fmt() function)
* Mend 'exit' without breaking 'exit 1'adam1996-09-121-3/+4
| | | | | | *blush* %-\ Pointed out by: bruce
* Backed out last change. It broke even `exit 1'.bde1996-09-121-4/+2
|
* Ok, lets try this again, shall we? It was definatly my mistake, notpeter1996-09-102-17/+33
| | | | Steve's.. :-]
* ack! back these out so I can see what I did wrong. It looks like apeter1996-09-102-31/+15
| | | | patch-by-hand botch, but it sig-11's during make world.
* Fix for PR#1248, sh doesn't expand past ${9}peter1996-09-102-17/+33
| | | | Submitted by: Steve Price <sprice@hiwaay.net>
* let the "exit" command return status when it is implicitadam1996-09-081-2/+4
|
* eek, how did that happen? I must have committed something left over frompeter1996-09-031-4/+4
| | | | when I was experimenting looking for an alternate format. *blush*
* Fix for PR#1287. This makes sh behave sensibly in case statements in thepeter1996-09-0313-49/+56
| | | | | | | | | | | | | | face of aliases. Note, bash doesn't do aliases while running scripts, but "real" ksh does.. Also: Reduce redundant .Nm macros in (unused) bltin/echo.1 nuke error2, it's hardly used. More -Wall cleanups dont do certain history operations if NO_HISTORY defined handle quad_t's from resource limits Submitted by: Steve Price <sprice@hiwaay.net> (minor tweaks by me)
* Misc cleanups and fixes from Bruce:peter1996-09-034-29/+40
| | | | | | | | | | - don't put \n on error() calls, error adds it already. - don't prepend "ulimit" on error() calls in miscbltin.c. - getopt typo on ulimit -p -> -u conversion - get/setrlimit() calls were not being error checked ulimit formatting cleanup from me, use same wording as bash on Bruce's suggestion. Add ulimit arg to output on Joerg's suggestion.
* oops, I didn't mean for the unconditional DEBUG code to go in, it's beenpeter1996-09-012-5/+5
| | | | | off in FreeBSD for some time. I realised this a few seconds after the commit started..
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-0172-2040/+2136
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* [HISTORY] command appeared in Version 1 AT&T UNIXwosch1996-08-291-1/+6
| | | | Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
* Take out 0201-0207 range - those characters abused by shache1996-08-122-5/+6
|
* Convert to newly added collate compare functionache1996-08-121-40/+4
|
* Simplify expressionache1996-08-121-2/+2
|
* Localize itache1996-08-114-12/+96
|
* Bring in my changes for removing the pestilent obj links (unless youjkh1996-06-242-7/+7
| | | | | really want them) from /usr/src. This is the final version of the patches, incorporating the feedback I've received from -current.
* Backup yacc changes.phk1996-06-022-5/+4
|
* Use new yacc rules. (I'm fixing the tree as fast as I can :-)phk1996-05-302-6/+7
|
* This commit was generated by cvs2svn to compensate for changes in r15920,peter1996-05-273-0/+168
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Import the 4.4BSD-Lite2 /bin/sh sourcespeter1996-05-2766-1222/+2226
| | | | | | | | | | | | | | | | Requested by: joerg (Note, this is mostly going to be conflicts, which is expected. Our entire sh source has a mainline, so this should not change anything except for a few new files appearing. I dont think they are a problem)
* | Fix the borokeness that crept in with rev 1.10 of parser.c, the shjoerg1996-02-032-3/+6
| | | | | | | | | | | | | | | | didn't correctly start background jobs anymore. Strange that nobody was complaining... Add a dummy target for `builtins' in the Makefile, to prevent it from attempting to build this file by compiling builtins.c. :-/
* | Restored formatting from the old printf/printf.c.bde1995-12-141-5/+5
| |
* | The shell incorrectly gave & precedence over ;. This breaks thejoerg1995-12-101-23/+19
| | | | | | | | | | | | | | | | | | | | | | traditional behaviour, and it violates Posix.2. Fixes PR # bin/880: /bin/sh incorrectly parse... Fixes also an earlier problem report about the shell not evaluating loops correctly. (Not files via GNATS.) Submitted by: nnd@itfs.nsk.su (Nickolay N. Dudorov)
* | Move out some of the shell builtin bogosity from printf's source tojoerg1995-12-101-1/+10
| | | | | | | | sh's builtin/bltin.h.
* | A fix for the "cd -" coredump on a brand new /bin/sh. The problem waspeter1995-11-141-2/+5
| | | | | | | | | | | | noticed on a NetBSD bugs mailing list but this is entirely my own work. Inspired by: Scott Reynolds <scottr@plexus.com>, for NetBSD
* | Implement allowing 'set -v' in the middle of a script to work.peter1995-11-031-78/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means that a script containing: echo 1 set -v echo 2 will now produce output, like it does on SYSV machines and other 'proper' /bin/sh implementations.. This is done by a slight restructure of the input processor allowing it to read chunks from the file at a time, but process the data by line from the chunk. Obtained from: Christos Zoulas for NetBSD. <christos@deshaw.com>
* | o rename ulimit -p into ulimit -u, so we are in agreement with bashjoerg1995-10-213-7/+12
| | | | | | | | | | | | | | o fix brokeness for 1>&5 redirection, where `5' was an invalid file descriptor, but no error message has been generated o fix brokeness for redirect to/from myself case
* | Implement the "ulimit" builtin. This is the analogon to csh's "limit"joerg1995-10-193-3/+269
| | | | | | | | | | | | | | | | | | command and badly needed in sh(1) for everybody who wants to modify the system-wide limits from inside /etc/rc. The options are similar to other system's implemantations of this command, with the FreeBSD additions for -m (memoryuse) and -p (max processes) that are not available on other systems.
* | Fix my breakage of the $0 handling during $ENV processing.joerg1995-10-091-2/+2
| | | | | | | | Since the broken version went into 2.1, this fix should, too.
OpenPOWER on IntegriCloud