summaryrefslogtreecommitdiffstats
path: root/bin/sh
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Make the mkinit internal command issue an #undef for each #define, tojoerg1995-10-011-3/+15
| | | | | | | | avoid "duplicate definition" warnings.
* | Posixize:joerg1995-10-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sh -c [-aCefinuvx] command_string [ command_name [argument ...] ] 1 4.56.3 Options -c Read commands from the command_string operand. Set the value of special parameter 0 (see 3.5.2) from the value of the command_name operand and the positional parameters ($1, $2, etc.) in sequence from the remaining argument operands. Pointed out by: Kaleb Keithly (kaleb@x.org)
* | Fix relocation of job table.bde1995-09-211-1/+8
| | | | | | | | | | | | while { sleep 1 & wait; } do echo 1; done corrupted the job table every 4th iteration.
* | Don't dereference a NULL pointer in the case of a null pipe.dg1995-09-201-2/+3
| | | | | | | | | | | | | | e.g.: ls |> foo.out sh now behaves the same as it does under SunOS 4.x for this case.
* | Sigh. This will become a never ending story. :-(joerg1995-08-281-1/+4
| | | | | | | | | | | | When comparing my recent parser change against the ash in 1.1.5.1, i found that a couple of other problems in the same area has been fixed there, but not in 2.2. Semicolons and EOF do also delimit words...
* | Make the shell handle a null command in a &&/|| sequence correctly.joerg1995-08-273-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The && and || tokens do also terminate a command, not only the newline. While i was at it, disabled trace code by default, it served no good purpose since it required the use of a debugger anyway to be turned on. Instead, placed a hint in the Makefile on how to turn it on. This makes the shell ~ 10 % faster and ~ 4 KB smaller. :) Pointed out by: jan@physik.TU-Berlin.DE (Jan Riedinger)
* | Clean up compilation warnings.pst1995-08-231-1/+4
| |
* | sh(1) incorrectly ignored an EOF condition when looking for thejoerg1995-08-111-1/+5
| | | | | | | | | | | | closing backquote in a `foo` substitution. Discovered by: Martin Welk <mw@theatre.pandora.sax.de>
* | Fix /bin/sh's broken handling of the builtin getopts(1). The optionsjoerg1995-08-061-3/+2
| | | | | | | | | | | | | | ``-ffoo'' and ``-f foo'' have been treated differently. This has been in violation of Posix.2 (that deprecates -ffoo, but doesn't disallow it).
* | Remove trailing whitespace.rgrimes1995-05-3016-58/+58
| | | | | | | | Reviewed by: phk
* | typo there --> theiradam1995-05-051-9/+16
| |
* | From "Philippe Charnier" <charnier@lirmm.fr>:dg1995-05-051-1/+5
| | | | | | | | | | | | | | | | | | There is a bug in sh: the built in command "fc -l" generates a core dump (*NULL in not_fcnumber). According to the sh manual page (fc -l [-nr] [first [last]]), fc -l is a correct sequence (in that case, values are defaulted to -16 and -1) but fails when first is not given.
* | Make build work, even if there is no obj subdir.phk1995-03-301-3/+11
| |
* | Fix the deletion of trailing newlines with backquote expansion.guido1995-03-011-2/+4
| | | | | | | | | | | | Reviewed by: Submitted by: Obtained from:
* | What I think is a more correct fix for the handling of backslashespaul1995-01-111-3/+3
| | | | | | | | inside backquotes. Reversed my previous fix.
* | Fix a bug with handling backslash escapes inside some quotes.paul1995-01-091-2/+2
| | | | | | | | Should solve our problems with edit-pr.
* | Obtained from: partly from 1.1.5bde1994-12-261-2/+4
| | | | | | | | | | Convert "" to "." for "cd" and "cd ''". chdir("") is required to fail on POSIX systems.
* | Add end of line check so mkinit doesn't produce garbage if you have apst1994-11-061-2/+2
| | | | | | | | | | | | | | | | MKINIT line that doesn't have a comment on it (we have at least two). This mkinit program was written by someone who obviously doesn't believe in defensive programming. :-( There's a LOT of work that needs to be done on this thing. :-( :-( :-(
* | Get this braindead, mongoloid shell look in /stand for pwd if it can'tjkh1994-11-061-3/+8
| | | | | | | | | | | | | | | | | | | | find it in /bin. This is something of a kludge, I know, but consider my limited alternatives: I can't make this an execvp() without making people scream that I introduced a failure point or slowed down pwd, and I can't make it an optional macro since crunch doesn't let you pass arbitrary command-line args to the build of one of its crunch-ees. This is the simplest, if not the nicest looking, solution I could come up with.
OpenPOWER on IntegriCloud