Commit Graph

128 Commits

Author SHA1 Message Date
Kelvin Sherlock
f325d45831 remove debug code from strings(1) 2012-09-02 15:55:14 -04:00
0df1477cf9 Before moving to git, checked in a bunch of apparent work-in-progress
files that have been sitting idle for a few years.  Unfortunately
I can't gaurantee at the moment that these even compile let alone build.
Caveat Emptor
2012-08-26 02:55:00 +00:00
7edb4eac39 Regression tests for gsh. 1999-11-30 20:28:24 +00:00
769328325f Output files of gsh built-in commands tests, for comparison against
run-time output.
1999-11-30 19:34:56 +00:00
74f2b97322 Changes for gsh version 2.0a1:
Fix PR#50 while maintaining backward compatibility: when new environment
variable $KEEPQUOTE is set, use the command line's original single and
double quotes unchanged (rather than removing all quotes and adding
double quotes as needed).

Fix PR#123: do not ignore command line characters following a ";" that
was not preceeded by a command.

Add signal handler for SIGTTIN (background read attempted from control
terminal) that prints a message and quits the shell. This is needed
because gsh will sometimes receive such a signal, go into the "suspended"
state, and never return to "running" state.

Add environment variable $ECHOX to print expanded commands before they
are executed.
1999-11-30 17:53:27 +00:00
efe58b60ff fixed some email addrs 1999-07-03 14:46:37 +00:00
e0806f3cbb FreeBSD files modified for GNO, plus additional required support files. 1999-05-27 00:27:20 +00:00
3f5e869b65 Makefile:
- modified for GNO base build
	- prototyped functions, general code cleanup
center.1, center.desc, center.rez:
	- initial checkin
1999-02-16 06:04:12 +00:00
ba2ef9169c kill.1:
- fixed minor formatting problem
1999-02-13 19:53:47 +00:00
05d82736bc Changes for gsh version 2.0d10:
Add check for buffer overflow when globbing, expanding variables, or
inserting aliases (PR#110).  Increase buffer size from 1024 to 4096.

Increase buffer for reading commands from 256 to 1024 bytes in order
to match the maximum length used when reading.
1999-02-08 17:26:51 +00:00
00cd830bd0 Makefile:
Changed to match the base builds.

	Renamed to doline.asm.  The default makefiles don't like to have
	name overloading like there was with binprint.c and binprint.asm

	- added a dummy segment
	- added the setcom directive

	- added stack checking code
	- prototyped functions
	- removed extraneous declarations
	- fflush stdout before writing to STDOUT_FILENO

binprint.1, binprint.desc, binprint.rez:
	- initial checkin
1999-01-16 18:35:57 +00:00
fc1083b2b0 binprint.c:
Reformattted source.  No substantive change.
1999-01-15 15:54:40 +00:00
8cea45f4f0 aroff.c:
- removed some dead code that I forgot about for the previous
1999-01-15 15:46:08 +00:00
d49f72c8b0 aroff.c:
- checked and reduced stack size to 1k (actually used is about 748)
	- changed awgs.h --> aroff.h
	- minor formatting changes
	- added some missing header files
	- eliminated a call to some old GNO v1.0 (?) stdio initialization
	- changed awgs.h --> aroff.h
	- minor formatting changes
1999-01-15 15:45:04 +00:00
d1c781eaf4 Makefile:
- completely changed for new builds
awgs.c, awgs.h:
	- renamed to aroff.c and aroff.h, respectively
	- inserted RCS Id tag
	- reformatted source (not substantive changes)
aroff.1, aroff.rez, aroff.desc:
	- initial checkin
1999-01-15 08:36:31 +00:00
96970e3e76 Makefile:
- changed path to libtermcap
1999-01-15 06:50:35 +00:00
41372644be Listed Tim Meekins as author, and removed reference to Free BSD code. 1999-01-14 23:55:58 +00:00
e586eeefeb Changes for gsh version 2.0d9:
Added additional optional debug code. A version of gsh with the memory
checking debug code turned on is available as an exe file.

Lock and unlock the hash mutual exclusion key in when disposing of the
hash table.

Allow five digits rather than four when printing the process number in
the ps command.

Piping the output of a command into a non-executable file no longer
causes gsh to hang.
1999-01-14 17:44:25 +00:00
28c606e490 Makefile:
- set up custom "release" and "install" targets for gsh
	- added describe entry
1999-01-08 07:38:47 +00:00
d073b63fc1 updated "FTP:" field in describe entry to fix site names; use current
names for trenco, ground, and caltech
1999-01-07 08:20:19 +00:00
9818323355 Makefile, rmdir.c:
Take contrib.h out of system include directory rather than the
	GNO source build directories.
1999-01-07 07:50:10 +00:00
508f00afb5 chtyp.desc:
corrected "Name:" field
1999-01-07 07:49:08 +00:00
6269a8ca25 Changes for gsh version 2.0d8:
Fixed several mutual exclusion problems, including a particularly nasty
one that would cause gsh to loop forever inside the memory manager. (You
could identify this one by the "BRA (-23)" at the bottom of the infinite

Fixed the string vector print routine to properly handle all numbers of
entries in the hash table.  Previously, it would always print duplicate
entries if there were < 6 commands hashed, and would sometimes print
duplicates (depending on previous contents of an internal table) for
other numbers of commands.

gsh would wait on background processes started from an exec file
(executed, not sourced). Now the exec file does not wait on the process,
but the background process is not associated with the parent shell after
the exec file terminates.

Made gsh globbing work more like csh: if none of the requested patterns
are found, print "No match" and exit.

At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc does not exist,
don't report a "file not found" error message. (PR#100)
1998-12-31 18:29:14 +00:00
2604b42f9a Due to PR#98, change it so that the builddate.rez file is always taken
out of 13/RInclude instead of /src/gno/  This implies that
builddate.rez has to have been previously installed in 13/RInclude; this
is done by the 'install' and 'release' targets in /src/gno/
1998-12-22 16:08:54 +00:00
e7f2691599 Changes for gsh version 2.0d7:
Fixed several memory leaks.

Prefix command without any parameter (to list the prefixes) would cause
memory corruption when prefix had been invoked previously with a parameter.

Sourcing a command file from within an exec file could cause gsh to
wait forever, depending upon the commands executed in the sourced file.

All built-in commands return appropriate status: 1 for error, 0 for no error.

Fixed several cases where incorrect value was set in $status.

Added usage strings for tset, hash, commands, and history.

Fixed memory corruption error when edit command had no parameters.

When system() is called with pointer = NULL or with a command string that
causes gsh to detect an error (e.g., incompatibility with | and <), return
status of -1. In other cases, return process's status rather than always 0.

System would crash when output from a non-forked command was piped to
another process; for example   clear | cat > /tmp/list
1998-12-21 23:57:08 +00:00
4879056d84 Changes for gsh version 2.0d6:
Fixed defect introduced in version 2.0d5: when a background job completed
while gsh was waiting for command line input, gsh would print a bogus error
message and quit.
1998-11-02 17:40:56 +00:00
963a33c4bf Changes for gsh version 2.0d5:
Add quotes around null parameters from the command line so they will be
parsed properly (resolves PR#84).

Output piped to an unfound command caused gsh to terminate, due to an
interface change to the GNO 2.0.6 version of getpgrp(2): it now returns the
process group of the caller.  To get the process group number for the
pid passed as a parameter pid, the call has to be made to _getpgrp(2).
In addition to fixing invoke.asm, updates were also made in jobs.asm.

When directory stack is full, pushd, reports a new error message: 'pushd:
Directory stack full'.  (Previously, 50 pushds would cause a crash.)

When parameter passed to "pushd +n" is <= 0, report a new error message:
'pushd: Invalid number'. (Previously, tried to chdir to the parameter.)

When a command appends to stderr (e.g., echo test >>&/tmp/err), stdin was
closed, due to errappend being defined as pipefds+2 rather than pipefds+4
in cmd.asm.

When there was an error reading stdin, gsh went into an infinite loop of
beeping and requesting more input. Changed getchar (in stdio.asm) and
GetCmdLine (in edit.asm) to report the error and terminate.

Code in cmd.asm set and reset handler for signal SIGSTOP (17). This makes
no sense, since there cannot be a handler for SIGSTOP. This was changed
to set and reset signal SIGTSTP (18) since that handler is used by gsh.

The error message "specify a command before redirecting" was never
caught by the invoke() subroutine because the next higher routine,
command(), checked for argv==0 before calling invoke(). The error
message was moved into command().
1998-10-26 17:04:51 +00:00
1dc5497309 Added startup protocol as requested by Devin Reed (PR#78) and Steve Reeves
(PR#85, PR#86):
   For login shells (command line starts with '-'),
	If $PATH doesn't start with ':' or contain a space,
	   change all ":" to " ".
	source /etc/glogin
	source $HOME/glogin
$HOME/gshrc is sourced afterward for both login and non-login shells.

Don't the print number of hashed commands (from "rehash") until all
initialization is completed.

Only pass exported environment variables to child processes, and prevent child
processes from changing parent's environment.

A null command followed by a redirection of stdout, for example
  > /tmp/list
would cause an error message "<garbage> not found" due to incorrect
setting of command buffer pointer.

Filename completion did not work following ">&" or ">" without a trailing

Entabbed all the asm files, saving more than 36,000 bytes.
1998-09-08 16:53:14 +00:00
2e0ebb5392 Replaced last of old shell calls with their newer counterparts. This
removed the need for p-string routines, so they were removed. Also
removed alloc256/free256 and associated data structures.

In removing calls, found instances in pwd & prefix commands and prompt
handler where current directory name was assumed to be < 256 characters;
recoded to use a flexible buffer size.

Updated and expanded mmdebug.asm routines that perform error checking on
memory management calls. Added macros ~NEW and ~DISPOSE that invoke either
the real or debug routines.

Fixed call to read $TERM variable's length to fix PR#81.

Removed echo of data when setting value of $< in expandvars (expand.asm).
The characters are echoed as they are typed and do not need to be reprinted
on stdout after carriage-return is typed.

Added error checking to the various flavors of prefix (just like cd):
  - Verify 2nd parameter is a valid directory before setting.
  - Verify 1st parameter < 32 before displaying or setting.
1998-08-03 17:30:30 +00:00
d534981038 Changed many invocations from old shell interface routines (Read_Variable,
Set_Variable, Export, etc.) to new ones (ReadVariableGS, SetGS, ExportGS,
etc.) in many places; there are still a few more to change.  This change
removed the 256-character limit on strings retrieved by these routines,
such as the value of environment variables. (PR # 9).

At startup do not set $TERM to gnocon if it is already set.

Removed the df command (from builtin.asm).

Defined macro incad to increment a 4-byte address, checking for overflow;
replaced instances of "inc ptr" with "incad ptr".

Changed column offset table to use a 1-word rather than 1-byte entry. This
resolves PR#14 (hash wouldn't print beyond first 256 filenames).

Fixed defect in unalias (alias.asm) where the double quote portion of the
scanner would look for a terminating single quote. This resolves PR#69.

Changed default order for copying files in $PATH dirs into executable list,
so earlier paths files are found first.

Added environment variable flag $OLDPATHMODE to make gsh behave in the old
(backwards order) way when necessary.

Discard duplicate filenames when hashing.

Fix PR#73: directory in $PATH with escaped space (\ ) is not searched.
1998-07-20 16:23:11 +00:00
01902c1b91 Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
   of expanded $HOME match the user's delimiter.

 * When wildcard patterns don't match, rather than terminating the command
   gsh now prints "No match: <pattern> ignored" and passes the command line
   minus the unmatched patterns on to be executed.

 * Modified echo command so it doesn't add a blank to the end.

 * Make "clear" and "source" built-ins non-forked commands.  Unforking
   "source" allows prefixes to be set in files that are sourced.

 * Add loop to parse a single command (removing leading whitespace) before
   sending it off to be expanded and executed. Skip null lines and comments
   at this level. This allows later commands that depend upon variables set
   in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
   Also fixes problems seen when tab was first character of multiple lines.

 * Initialize environment variable flags at startup (for echo, nodirexec,
   nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
   flag when env var is set in upper or lower case (formerly, only worked
   with lower case).

 * Lots of places two-word addresses are incremented using inc, without
   checking for overflow into the high-order word. As these are discovered,
   they are changed to use adc on both words.

See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
4bd91df5de Fixed "ls -s" kilobyte calculation. See PR#48 for details. 1998-06-17 07:00:27 +00:00
a43a7e27fd Trying a test cvs checkin. 1998-06-17 05:13:38 +00:00
94012d9889 edit.c:
- initial checkin
1998-06-12 05:06:24 +00:00
cd8bfae836 Create *.mac files from gsh.mac via Makefile.
Added direct-page/stack data segment of size 2048 to main.asm.  It is
initialized to be filled with "?" characters, so that it can be examined
to see how much space is actually being used.
1998-06-09 16:22:56 +00:00
c39b230a61 gsh.1:
- initial checkin.  This is mainly just a pointer to the reference
1998-06-04 03:11:28 +00:00
69723f10b6 Makefile:
- except for main.root, delete all created *.root files just after
	  they're made.  This avoids duplicate symbols in the link step.
1998-05-30 17:21:40 +00:00
068fd5bb72 Change call of execve to _execve. 1998-05-11 19:18:43 +00:00
f6ad5e32aa To.Do, UpdateLog:
Added explanation of the (minor) changes made in the initial
	v2.0.6 checkin, and what still needs to be done.

	Minor formatting change on some lines.

link.script, mods:
	These files are obsolete.
1998-04-28 05:51:26 +00:00
d2efd0151f Initial checkin of man pages for some of the gsh builtin commands.
Not all builtins are represented here.  Some information (such as
a dependancy on the 31/ prefix) is probably out of date, too.
1998-04-28 05:18:13 +00:00
cf2e1b8db9 dotests:
- updated paths to sed and the split binary under test
1998-04-28 05:08:38 +00:00
61474a874f This checkin contains only enough changes that gsh is able to assemble
and link.  However, it does not work yet and thus still needs work.

The *.asm files have had the following common changes:
	- 'keep' lines were eliminated
	- the 'mcopy' now takes the macro from the /obj/gno/bin/gsh
	  directory.  This is in anticipation of having the macro
	  files generated from a single source file; there is a large
	  amount of duplication.  For the moment, the makefile merely
	  copies the old macro files from the "M" directory to the
	  /obj/gno/bin/gsh directory.
	- start each file with a dummy routine so that the source
	  code winds up in the *.o rather than the *.root file.
	- added the 'setcom 60' directive; there were many source
	  lines that were otherwise getting truncated.

The makefile is a complete rewrite.
1998-04-24 15:38:47 +00:00
e72e1c891f Initial checkin of what is believed to be tar v2.0. There was a
tar v2.0.1 binary distributed on the 'net that claimed to have fixed
an unspecified bug in this version, but neither the sources nor
the originator of that fix are available.

It may be appropriate to completely replace this implementation.
1998-04-10 19:30:29 +00:00
ade81f0a94 Initial checkin of the GNO v2.0.4 strings(1) util. No changes yet for
GNO v2.0.6, other than a GNO-formatted man page was created from the
BSD original.
1998-04-10 19:21:40 +00:00
e51b60e6cf These are changes that apparently bring the version number to 2.0.
However, judging from the comments at the top of the source file,
the v2.0 changes were based on more v1.31 rather than 1.4.  When
this program is updated, these diffs should be evaluated.  (Unless,
of course, the current version is tossed in favor of a recent BSD

Here are the comments for the changes from v1.31 to v1.4 that may have
been dropped while moving to v2.0.  See the cvs diffs for details:

> v1.4  - Termcap support has been added and tested.  Look for a soon to be
>         faster version coming soon to a ~/bin directory near you!
> v1.32 - uses isatty(x) instead of fstat.  more portable (opinion).
>         soon to be added, TERMCAP support, won't that be nice?
1998-04-10 19:10:01 +00:00
861f178146 Initial checkin of more v1.4. I've converted the manual page from
aroff source to nroff source so that it can go into the repository
(binary files are not handled well in cvs).
1998-04-10 19:02:04 +00:00
2a99711c42 Initial checkin. These have no modifications for GNO v2.0.6, other
than I assigned version numbers to previous releases.  The most current
was v1.4.  See the comments at the top of du.c.
1998-04-10 18:13:27 +00:00
027b934919 This is asm version 1.1 of date(1), also by Phil Vandry. There are still
no GNO v2.0.6 specific changes.
1998-04-10 18:03:48 +00:00
98f457ebec Initial checkin of asm version 1.0 of date(1) by Phil Vandry (no changes
for GNO v2.0.6).  I've not checked, but it's unlikely that this is
POSIX compliant.
1998-04-10 18:00:18 +00:00
a26d64bf05 The 'fulltests' script is now located in gno/ 1998-03-11 05:28:01 +00:00