add directory bin

This commit is contained in:
gohigh
2024-02-19 00:21:52 -05:00
parent 1b1e027f34
commit 42f484790f
611 changed files with 242668 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
This is zoo and fiz from Rahul Dhesi compiled for Linux. It is a very
popular PD archiver in the Ms-Dog world.
Roger
cs89rdb@brunel.ac.uk

BIN
bin/Archivers/fiz Normal file

Binary file not shown.

BIN
bin/Archivers/lha Normal file

Binary file not shown.

Binary file not shown.

BIN
bin/Archivers/zoo Normal file

Binary file not shown.

Binary file not shown.

BIN
bin/Archivers/zoo.tar.gz Normal file

Binary file not shown.

117
bin/INFO-SHEET.txt Normal file
View File

@@ -0,0 +1,117 @@
LINUX INFORMATION SHEET
(last updated 13 Jan 1992)
1. WHAT IS LINUX 0.12
LINUX 0.12 is a freely distributable UNIX clone. It implements a
subset of System V and POSIX functionality. LINUX has been written
from scratch, and therefore does not contain any AT&T or MINIX
code--not in the kernel, the compiler, the utilities, or the libraries.
For this reason it can be made available with the complete source code
via anonymous FTP. LINUX runs only on 386/486 AT-bus machines; porting
to non-Intel architectures is likely to be difficult, as the kernel
makes extensive use of 386 memory management and task primitives.
Version 0.12 is still a beta release, but it already provides much
of the functionality of a System V.3 kernel. For example, various
users have been able to port programs such as bison/flex without having
to modify code at all. Another indication of its maturity is that
it is now possible to do LINUX kernel development using LINUX itself
and freely-available programming tools.
2. LINUX features
- System call compatible with a subset of System V and POSIX
- Full multiprogramming (multiple programs can run at once)
- Memory paging with copy-on-write
- Demand loading of executables
- Page sharing of executables
- Virtual memory: swapping to disk when out of RAM
- POSIX job control
- virtual consoles on EGA/VGA screens
- pty's
- some 387-emulation
- ANSI compliant C compiler (gcc)
- A complete set of compiler writing tools
(bison as yacc-replacement, flex as lex replacement)
- The GNU 'Bourne again' shell (bash)
- Micro emacs
- most utilities you need for development
(cat, cp, kermit, ls, make, etc.)
- Over 200 library procedures (atoi, fork, malloc, read, stdio, etc.)
- Currently 4 national keyboards: Finnish/US/German/French
- Full source code (in C) for the OS is freely distributable
- Full source code of the tools can be gotten from many anonymous ftp sites
(Almost the entire suite of GNU programs has been ported to Linux.)
- Runs in protected mode on 386 and above
- Support for extended memory up to 16M on 386 and above
- RS-232 serial line support with terminal emulation, kermit, zmodem, etc.
- Supports the real time clock
3. HARDWARE REQUIRED
- A 386 or 486 machine with an AT-bus. (EISA will probably work, also,
but you will need an AT-bus hard disk controller.)
Both DX and SX processors will work.
- A hard disk implementing the standard AT hard disk interface--
for example, an IDE drive. SCSI drives are not supported yet.
- A high-density disk drive--either 5.25" (1.2MB) or 3.5" (1.44MB).
- At least 2 megabytes of RAM. (LINUX will boot in 2 Mb. To use
gcc 4 MB is a good idea.)
- Any video card of the following: Hercules,CGA,EGA,VGA
In addition, LINUX supports
- Up to two serial lines
- A real time clock
4. PARTIAL LIST OF UTILITIES INCLUDED IN OR AVAILABLE FOR LINUX 0.12
- The MTOOLS package (reading/writing to DOS filesystems)
- The complete GNU filetools (ls, cat, cp, mv, ...)
- The GNU C compiler with GNU assembler, linker, ar, ...
- bison
- flex
- rcs
- pmake (BSD 4.3 Reno/BSD 4.4 make)
- kermit
- Micro emacs
- less
- mkfs
- fsck
- mount/umount
5. LINUX BINARIES
The LINUX binaries and sources are available at three
anonymous FTP sites. These are:
nic.funet.fi:/pub/OS/Linux
tsx-11.mit.edu:/pub/linux
tupac-amaru.informatik.rwth-aachen.de:/pub/msdos/replace
6. LEGAL STATUS OF LINUX
Although LINUX is supplied with the complete source code, it is
copyrighted software. Unlike MINIX, however, it is available for free,
provided you obey to the rules specified in the LINUX copyright.
7. NEWS ABOUT LINUX
Since LINUX's introduction to the public there has been a rapidly
growing mailing list, "linux-activists@niksula.hut.fi". To subscribe to
this list, mail to "linux-activists-request@niksula.hut.fi". If the
traffic in this lists increases further, there are plans to swap ( at
least partially ) over to comp.os.misc, so watch out for any LINUX
articles in this group. For the current status of LINUX, do "finger
torvalds@kruuna.helsinki.fi".
8. FUTURE PLANS
Work is underway on LINUX version 1.0, which will close some of the
gaps in the present implementation. Various people are currently working
on:
- A virtual filesystem layer
- STREAMS
- init/getty/login
- Interprocess communication
- IEEE POSIX P1003.1 / P1003.2 compatibility
- SCSI support
If you want to help, join the mailing list.

1
bin/NEWEST_IS_0.98.3 Normal file
View File

@@ -0,0 +1 @@
So, look dates.

89
bin/NOT-Old/README.FIRST Normal file
View File

@@ -0,0 +1,89 @@
Before I forget! This code, binaries, etc. all fall under the GNU
software license. I have included a copy of it in this directory, for
your reading pleasure. The sources are also covered by additional
copyrights.
This is a preliminary port of libc-4.6.27 for the Alpha. The code has
been taken from several sources, including the original Linux libc,
the version of 4.x that was released for the 32-bit port of Linux to
the Alpha, and glibc-1.0.9. In particular, the math routines are the
generic version found in glibc, and much of the system-specific code
was taken from the 32-bit Alpha libc. Much credit goes to Jim Paradis
for making gcc available & putting up the source to the 1.0 libc!
The library has been tested fairly extensively; all of the tests
included with the library have passed, and it has been used to
successfully build many small and large apps, including emacs and gcc;
perl needs to be tested, not because it's useful but because it's
evil.
You'll need to be using at least kernel version 1.3.1 for this to work
properly, and preferably the latest 1.3.x kernel release.
Several system calls are still non-functional because they are missing
from the kernel. These calls currently invoke the appropriate syscall
in the kernel, but if it's not currently implemented you will see a
message on the console containing a string like
sc<num,x,x>
where num is the number of the syscall.
A few others have been emulated a la the OSF/1 way: time, stime,
alarm, times, nice and creat. pause() has been faked with a while
loop and a long sleep(). utimes and utime do the correct things.
I/O calls (outb, outw, inb, inw, ioperm) have been implemented by
David Mosberger-Tang (davidm@cs.arizona.edu). They currently only work
on the Noname systems, and any programs compiled with this library
will also only work on a Noname system. We hope to eventually have
this issue resolved, however, with runtime detection of the machine &
doing the appropriate thing depending on what platform the program is
running on.
Probably the biggest lack is that the IEEE FPU code doesn't work,
because I haven't been able to come up with a fpu_control.h header
with the appropriate defines. I haven't noticed any problems, but...
Most of the necessary changes to the library made were because stabs
aren't working, so a lot of the aliasing had to be redone (and
unfortunately, there is some overhead because many of the calls are
being done with an additional level of indirection). Many of the
makefiles had to be altered to accomodate the new configuration
issues. And not a few bugs got fixed in the process.
INSTALLATION
You'll need to install a copy of gcc-2.7.0 from grocne.enc.org in
/pub/alpha. Grab the gcc-2.7.0-bins.tar.gz file, su to root, and
extract it from /. If you installed Jim Paradis' gcc-2.6.0, you'll
need to remove it first, along with gas and ld.
Once gcc is installed, su to root and untar this file from /. It'll
put includes in /usr/include & libraries in /usr/lib.
In theory, you now have a working "linux" development environment.
99% of the headers are unchanged from the standard libc-4.6.27
installation, and the libraries work almost the same, so configuring
software for linux will *usually* allow it to build without any
problems.
The biggest difficulty I've run into is software that tries to work
with both OSF/1 and Linux. Many programs also assume that if __alpha__
or __alpha is defined it's on a box running OSF/1, but they also see
that linux is defined. So the programs try to configure themselves
for both OSes, with varying degrees of success.
Emacs requires a little bit of mangling to work correctly, as well as
tcsh; I can make diffs available if desired. Most of the linux-specific
programs (such as util-linux) require no changes. And GNU textutils,
shellutils, and fileutils built right out of the box for me--no
changes were needed at all.
The networking code is very similar to the Linux one currently. This
will probably be changing in the near future to be as fully BSD
compatible as possible--gratuitous changes for the sake of Linux seem
foolish to me.
Good luck! If you find problems, or fix things, please let me know.
Bob
manson@magnus.acs.ohio-state.edu

Binary file not shown.

Binary file not shown.

BIN
bin/NOT-Old/gdb.tar.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

35
bin/PBMPlus.README Normal file
View File

@@ -0,0 +1,35 @@
Here are the PBMPlus utilities originally written by Jef Poskanzer, including
the libtiff libraries written by Sam Leffler of SGI. There are two files,
for those who just want binaries (sorry, no man pages there), then you should
get pbmplus.bin.tar.Z. If you want the man pages and sources get the other
file pbmplus.src.tar.Z also.
I've built this on Linux 0.95c+, with gcc-2.1 with success. To build the
package, login as root, cd to /, and tar xzvf pbmbin.tar.Z, then tar xzvf
pmbsrc.tar.Z. Once they're done, cd to /usr/local/pbmplus10dec91/libtiff,
type make (make sure you have lots of swap space available), then cd ..
and type make install. This should build and install all the utilities and
man pages for you. All you have to do is add /usr/local/pbmplus to your
path and play with some images.
Sorry, there's no viewer here (that I know of). Perhaps later I can add one.
But in the meantime ... Have fun. My early tests show that this runs about
1.25 times as fast as a MicroVax II, running Ultrix 3.1.
Oh yea, I believe the binaries are built NOT using shared libs - someone pleaes
check me on this. But, the Makefiles all specifiy that NEW images built will
use shared libraries. Small inconsistency, but I figured those who would
build their own would probably want the shared binaries anyway.
Enjoy! If you have questions I'll try to help, but I only check this mail
about once a week since it's long distance. But if you get stuck and aren't
in a hurry, email me at
Louie.Williams@bbs.oit.unc.eud
Thanks to everybody responsible for Linux! I can't imagine PBMPlus on DOS!
-Lou Williams

10
bin/README.curses Normal file
View File

@@ -0,0 +1,10 @@
curses.tar.Z contains the curses library from bsd-net-2, with
pre-installed diffs & RCS files for linux changes.
You'll need to use 'pmake' to build it, or reconstruct the Makefile.
I'm not completely certain that I got all of the raw(), crmode() etc
stuff right. If you have applications that use curses, try them out and
send back patches if you find bugs.
John Kohl <jtkohl@cs.berkeley.edu>

BIN
bin/agrep/agrep-2.04.tar.gz Normal file

Binary file not shown.

1
bin/agrep/agrep.README Normal file
View File

@@ -0,0 +1 @@
I believe this is about the easiest port I've never done. It compiles with GCC 1.4 (haven't gotten around to fiddling with 2.1 just yet) without a hitch.No configuration, no defines, no nuthin'. Just un-tar it, type "make", and away we go! Not so much as a peep from the compiler. I haven't tested it exhaustively, but I fooled around with it for a while, and it seems to work fine. One last note. For the time being, my only access to the internet is through a VAX running VMS. Since VMS uses 512-byte, fixed-length records forbinary files, the size will be rounded up to the next multiple of 512. Thecorrect sizes are: agrep-2.04.tar.Z - 62351 agrep.Z - 37706 agrep.ps.1.Z - 74055 agrep.ps.2.Z - 41544 I don't think it should cause any problems, but tar will probably bitch aboutthe trailing garbage. If that bothers you, use touch to fix the size beforeyou uncompress them.Ciao! Hutch. (hutchinson@wrair-emh1.army.mil)The rest of this file is the original readme from cs.arizona.edu.------------------------------------------------------------------------------This is version 2.04 of agrep - a new tool for fast text searching allowing errors.agrep is similar to egrep (or grep or fgrep), but it is much more general(and usually faster).The main changes from version 1.1 are 1) incorporating Boyer-Mooretype filtering to speed up search considerably, 2) allowing multi patterns via the -f option; this is similar to fgrep, but from our experience agrep is much faster, 3) searching for "best match" without having tospecify the number of errors allowed, and 4) ascii is no longer required.Several more options were added.To compile, simply run make in the agrep directory after untar'ingthe tar file (tar -xf agrep-2.04.tar will do it).The three most significant features of agrep that are not supported bythe grep family are 1) the ability to search for approximate patterns; for example, "agrep -2 homogenos foo" will find homogeneous as well as any other word that can be obtained from homogenos with at most 2 substitutions, insertions, or deletions. "agrep -B homogenos foo" will generate a message of the form best match has 2 errors, there are 5 matches, output them? (y/n)2) agrep is record oriented rather than just line oriented; a record is by default a line, but it can be user defined; for example, "agrep -d '^From ' 'pizza' mbox" outputs all mail messages that contain the keyword "pizza". Another example: "agrep -d '$$' pattern foo" will output all paragraphs (separated by an empty line) that contain pattern.3) multiple patterns with AND (or OR) logic queries. For example, "agrep -d '^From ' 'burger,pizza' mbox" outputs all mail messages containing at least one of the two keywords (, stands for OR). "agrep -d '^From ' 'good;pizza' mbox" outputs all mail messages containing both keywords.Putting these options together one can ask queries likeagrep -d '$$' -2 '<CACM>;TheAuthor;Curriculum;<198[5-9]>' bibwhich outputs all paragraphs referencing articles in CACM between 1985 and 1989 by TheAuthor dealing with curriculum. Two errors are allowed, but they cannot be in either CACM or the year (the <> brackets forbid errors in the pattern between them). Other features include searching for regular expressions (with orwithout errors), unlimited wild cards, limiting the errors to only insertions or only substitutions or any combination, allowing each deletion, for example, to be counted as, say, 2 substitutions or 3 insertions, restricting parts of the query to be exact and parts to be approximate, and many more.agrep is available by anonymous ftp from cs.arizona.edu (IP 192.12.69.5)as agrep/agrep-2.04.tar.Z (or in uncompressed form as agrep/agrep-2.04.tar).The tar file contains the source code (in C), man pages (agrep.1),and two additional files, agrep.algorithms and agrep.chronicle,giving more information.The agrep directory also includes two postscript files: agrep.ps.1 is a technical report from June 1991 describing the design and implementation of agrep;agrep.ps.2 is a copy of the paper as appeared in the 1992Winter USENIX conference.Please mail bug reports (or any other comments) to sw@cs.arizona.edu or to udi@cs.arizona.edu.We would appreciate if users notify us (at the address above)of any extensions, improvements, or interesting uses of this software.January 17, 1992BUGS_fixed/option_update1. remove multiple definitions of some global variables.2. fix a bug in -G option.3. fix a bug in -w option.January 23, 19924. fix a bug in pipeline input.5. make the definition of word-delimiter consistant.March 16, 19926. add option '-y' which, if specified with -B option, will alwaysoutput the best-matches without a prompt.April 10, 19927. fix a bug regarding exit status.April 15, 1992

BIN
bin/agrep/agrep.gz Normal file

Binary file not shown.

BIN
bin/agrep/agrep.ps.1.gz Normal file

Binary file not shown.

BIN
bin/agrep/agrep.ps.2.gz Normal file

Binary file not shown.

BIN
bin/as.doc.gz Normal file

Binary file not shown.

BIN
bin/as86.tar Normal file

Binary file not shown.

BIN
bin/ash-linux-0.2.tar.gz Normal file

Binary file not shown.

Binary file not shown.

BIN
bin/bin86-0.16.9.tar Normal file

Binary file not shown.

BIN
bin/bin86-0.16.9.tar.bz2 Normal file

Binary file not shown.

53
bin/bootset.c Normal file
View File

@@ -0,0 +1,53 @@
/********************************************************/
/* Rootset.c - modify Linux bootdisk root device entry */
/* - quick Turbo C hack by Iain_Reid@ed.ac.uk */
/********************************************************/
#include <stdio.h
#include <conio.h>
#include <process.h>
#include <dos.h>
void main(int ac, char **av)
{
char buf[512];
if (ac != 3) {
fprintf (stderr, "%s: update Linux bootimage root device details.\n",
av[0]);
fprintf (stderr, "Usage: %s <Major> <Minor>\n", av[0]);
exit (-1);
}
/**************************************************************/
/* Don't remove this keypress bit 'cos it gives you a chance */
/* to run this program from your dos boot floppy, remove that */
/* disk, put your linux boot disk into the same drive, patch */
/* in the new root device details and save them. No HD or */
/* rawrite required! (v. handy if DOS is dead) */
/**************************************************************/
printf ("Insert Linux boot disk into drive A and press any key\n");
getch();
if (absread (0, 1, 0, &buf) != 0) {
perror ("Disk reading problem");
exit (-1);
}
printf ("Current rootdevice: Major %d Minor: %d\n", buf[509], buf[508]);
buf[508] = atoi (av[2]);
buf[509] = atoi (av[1]);
if (abswrite (0, 1, 0, &buf) != 0)
{
perror ("Disk writing problem");
exit (-1);
}
printf ("New rootdevice: Major %d Minor: %d\n", buf[509], buf[508]);
exit(0);
}

BIN
bin/calls.tar.gz Normal file

Binary file not shown.

125
bin/cawf2.cdiff Normal file
View File

@@ -0,0 +1,125 @@
*** orig/makefile Thu Feb 21 17:15:06 1991
--- makefile Wed Feb 5 10:38:20 1992
***************
*** 4,12 ****
#
# define STDLIB for systems that have <stdlib.h>
DEFS = -DUNIX -DSTDLIB
! CFLAGS = -g ${DEFS}
HDR = cawf.h regexp.h regmagic.h
--- 4,14 ----
#
# define STDLIB for systems that have <stdlib.h>
+ CC = gcc
+
DEFS = -DUNIX -DSTDLIB
! CFLAGS = ${DEFS}
HDR = cawf.h regexp.h regmagic.h
*** orig/bsfilt.c Thu Feb 21 17:14:54 1991
--- bsfilt.c Sat Jan 18 20:15:50 1992
***************
*** 45,51 ****
int Ulx = 0; /* underline buffer index */
void Putchar();
! #ifndef STDDEF
char *strrchr();
#endif
--- 45,51 ----
int Ulx = 0; /* underline buffer index */
void Putchar();
! #ifndef STDLIB
char *strrchr();
#endif
*** orig/cawf.c Thu Feb 21 17:14:54 1991
--- cawf.c Sat Jan 18 20:15:50 1992
*** orig/cawf.h Thu Feb 21 17:14:54 1991
--- cawf.h Wed Feb 5 10:43:06 1992
***************
*** 40,46 ****
#include "regexp.h"
#ifdef UNIX
! #define CAWFLIB "/Homes/abe/src/cawf" /* UNIX library location */
#else
#define CAWFLIB "c:/sys/lib/cawf" /* PC-DOS library location */
#endif
--- 40,46 ----
#include "regexp.h"
#ifdef UNIX
! #define CAWFLIB "/usr/local/lib" /* UNIX library location */
#else
#define CAWFLIB "c:/sys/lib/cawf" /* PC-DOS library location */
#endif
*** orig/error.c Thu Feb 21 17:14:56 1991
--- error.c Sat Jan 18 20:15:50 1992
*** orig/expand.c Thu Feb 21 17:14:56 1991
--- expand.c Sat Jan 18 20:15:50 1992
*** orig/expr.c Thu Feb 21 17:14:56 1991
--- expr.c Sat Jan 18 20:15:50 1992
*** orig/macsup.c Thu Feb 21 17:14:56 1991
--- macsup.c Sat Jan 18 20:15:50 1992
*** orig/output.c Thu Feb 21 17:14:56 1991
--- output.c Sat Jan 18 20:15:50 1992
*** orig/pass2.c Thu Feb 21 17:14:58 1991
--- pass2.c Sat Jan 18 20:15:50 1992
*** orig/pass3.c Thu Feb 21 17:14:58 1991
--- pass3.c Sat Jan 18 20:15:50 1992
*** orig/regerror.c Thu Feb 21 17:14:58 1991
--- regerror.c Sat Jan 18 20:15:50 1992
*** orig/regexp.c Thu Feb 21 17:15:00 1991
--- regexp.c Sat Jan 18 20:25:37 1992
***************
*** 708,714 ****
register char *string;
{
register char *s;
! extern char *strchr();
/* Be paranoid... */
if (prog == NULL || string == NULL) {
--- 708,714 ----
register char *string;
{
register char *s;
! /* extern char *strchr(); */
/* Be paranoid... */
if (prog == NULL || string == NULL) {
***************
*** 807,813 ****
{
register char *scan; /* Current node. */
char *next; /* Next node. */
! extern char *strchr();
scan = prog;
#ifdef DEBUG
--- 807,813 ----
{
register char *scan; /* Current node. */
char *next; /* Next node. */
! /* extern char *strchr(); */
scan = prog;
#ifdef DEBUG
*** orig/regexp.h Thu Feb 21 17:15:00 1991
--- regexp.h Sat Jan 18 19:55:38 1992
*** orig/regmagic.h Thu Feb 21 17:15:00 1991
--- regmagic.h Sat Jan 18 20:10:06 1992
*** orig/store.c Thu Feb 21 17:15:00 1991
--- store.c Sat Jan 18 20:26:26 1992
*** orig/string.c Thu Feb 21 17:15:02 1991
--- string.c Sat Jan 18 20:27:18 1992

BIN
bin/cawf2.zip Normal file

Binary file not shown.

104
bin/df.c Normal file
View File

@@ -0,0 +1,104 @@
/* df.c: Copywrite (92) Peter MacDonald: distribute freely, don't restrict. */
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <linux/fs.h>
char *hdr1="\n inodes inodes inodes blocks blocks blocks mount";
char *hdr2= "device total used free total used free point";
char *hdr3= "--------------------------------------------------------------------";
char *fmt = "%-9s %-7d %-7d %-7d %-7d %-7d %-7d %s\n";
void do_df(char *dev, char *dir);
int main(int argc, char *argv[])
{ int i;
sync();
puts(hdr1);
puts(hdr2);
puts(hdr3);
if (argc != 1)
for (i=1; i<argc; i++)
do_df(argv[i],"");
else
{ FILE *F = fopen("/etc/mtab","r");
if (!F)
{ fprintf(stderr,"/etc/mtab not found\n");
exit(1);
}
do
{ char buf[200], dev[40], dir[150];
fgets(buf,200,F);
if (feof(F) || (strlen(buf)<6))
break;
sscanf(buf,"%s %s",dev,dir);
do_df(dev,dir);
} while (1);
}
exit(0);
}
#define oops(str,arg) { fprintf(stderr,str,arg); close(fd); return; }
int fd;
int nibblemap[] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4 };
ino_t count(unsigned numblocks, unsigned numbits)
{ unsigned i, j, end, sum = 0;
char buf[BLOCK_SIZE];
for (i=0; (i<numblocks) && numbits; i++)
{
if (read(fd,buf,sizeof(buf))<0)
return(0);
if (numbits >= (8*BLOCK_SIZE))
{
end = BLOCK_SIZE;
numbits -= 8*BLOCK_SIZE;
}
else
{ int tmp;
end = numbits >> 3;
numbits &= 0x7;
tmp = buf[end] & ((1<<numbits)-1);
sum += nibblemap[tmp&0xf] + nibblemap[(tmp>>4)&0xf];
numbits = 0;
}
for (j=0; j<end; j++)
sum += nibblemap[buf[j] & 0xf] + nibblemap[(buf[j]>>4)&0xf];
}
return(sum);
}
void do_df(char *dev, char *dir)
{ int it,iu,bt,bu;
struct super_block supstruct;
if ((fd=open(dev,O_RDONLY))<0)
oops("df can't open device: %s",dev);
lseek(fd,BLOCK_SIZE,SEEK_SET);
if (read(fd,(char*)&supstruct,sizeof(struct super_block))
!= sizeof(struct super_block))
oops("super block unreadable: %s",dev);
lseek(fd,BLOCK_SIZE*2,SEEK_SET);
if (supstruct.s_magic != SUPER_MAGIC)
oops("not a valid file system: %s",dev);
it = supstruct.s_ninodes;
iu = count(supstruct.s_imap_blocks,supstruct.s_ninodes+1);
bt = supstruct.s_nzones << supstruct.s_log_zone_size;
bu = count(supstruct.s_zmap_blocks,supstruct.s_nzones) <<
supstruct.s_log_zone_size;
printf(fmt,dev,it,iu,it-iu,bt,bu,bt-bu,dir);
}

BIN
bin/diskbackup.tar.gz Normal file

Binary file not shown.

BIN
bin/disksplit.tar.gz Normal file

Binary file not shown.

34
bin/doshell.c Normal file
View File

@@ -0,0 +1,34 @@
#include <stdio.h>
#include <sys/file.h>
#include <errno.h>
extern char *sys_errlist[];
main(int argc, char *argv[])
{
if (argc != 3) {
fprintf(stderr, "usage: doshell <ttyname> <shellname> &\n");
exit(1);
}
/* close down fd's */
close(0);
close(1);
close(2);
/* detach from parent process's group */
setsid();
/* open new tty */
if (open(argv[1], O_RDWR, 0) == -1)
exit(2);
dup(0);
dup(0);
execlp(argv[2], "-", 0);
/* should appear on new tty...: */
fprintf(stderr, "can't exec shell: %s\n", sys_errlist[errno]);
exit(3);
}

View File

@@ -0,0 +1,34 @@
Begin2
Title = Dual Monitor Patches
Version = 0.99.13.0
Desc1 = A small set of patches for the linux 0.99.13 kernel to allow simultaneous
Desc2 = use of both a colour VGA card and a Mono card (and monitors!) on one pc.
Desc3 = not guarenteed to work with X or any other graphics applications.
Desc4 = allows dynamic swapping of consoles between monitors.
Author = Jeff Grills
AuthorEmail = jefftep@cs.utexas.edu
Maintainer = Jeff Grills
MaintEmail = jefftep@cs.utexas.edu
Site1 = sunsite.unc.edu
Path1 = /pub/Linux/kernel/misc-patches
File1 = dual-mon.0.99.13.0.tar.z
FileSize1 = 12k
Site2 = tsx-11.mit.edu
Path2 = /pub/linux/ALPHA/dual-mon
File2 = dual-mon.0.99.13.0.tar.z
FileSize2 = 12k
Site3 = nic.funet.fi
Path3 = /pub/OS/Linux/kernel
File3 = dual-mon.0.99.13.0.tar.z
FileSize3 = 12k
Required1 = linux kernel 0.99pl12 or 0.99pl13
Required2 = both colour and mono video cards
CopyPolicy1 = same as the linux kernel sources
Keywords = dual monitors
Comment1 = not guarenteed to work with X or graphics applications
RelFiles1 = linux kernel
Entered = 26OCT94
EnteredBy = Jeff Grills
CheckedEmail = jefftep@cs.utexas.edu
End

Binary file not shown.

BIN
bin/dual-mon.09910.tar.z Normal file

Binary file not shown.

114
bin/dvorak.patch Normal file
View File

@@ -0,0 +1,114 @@
From: mper@uipsuxb.ps.uiuc.edu (Michael Pereckas)
This patch for linux/kernel/chr_drv/keyboard.S does two things: it
causes the ./del key on the keypad to produce a period, instead of a
comma, and it adds a Dvorak keyboard.
The first change will probably appeal to US users. Others may prefer
the comma. If there is a lot of difference of opinion on this, maybe
num_table should be moved into the national keyboard definitions. The
second change is great if you, like me, like the Dvorak keyboard
layout. Unfortunatly, the only way to change keyboards is to reboot
with a different kernel, so the Dvorak keyboard is a problem is more
than one person use the machine and they don't all know Dvorak. (this
only effects the console, serial port connections are uneffected.)
I post this on the off chance that someone is interested. If you
choose to use this, remember that although it seems to work fine for
me, this is an example of "programming by meta-w", that is, I copied
the US keyboard definition (using the emacs command meta-w) and
modified it, without really understanding it.
This patch is for linux/kernel/chr_drv/keyboard.S
It works for all the 0.95* versions, I think (!)
********** CUT HERE **********
*** keyboard.S.ori Wed Apr 8 16:57:58 1992
--- keyboard.S Wed Apr 8 17:03:10 1992
***************
*** 18,23 ****
--- 18,24 ----
* KBD_FR for Frech keyboard
* KBD_UK for British extended keyboard
* KBD_DK for Danish keyboard
+ * KBD_DVORAK for Dvorak (US) keyboard
*/
.text
***************
*** 251,257 ****
.ascii "789-456+1230."
#else
num_table:
! .ascii "789-456+1230,"
#endif
cur_table:
.ascii "HA5-DGC+YB623"
--- 252,258 ----
.ascii "789-456+1230."
#else
num_table:
! .ascii "789-456+1230."
#endif
cur_table:
.ascii "HA5-DGC+YB623"
***************
*** 611,616 ****
--- 612,667 ----
.byte 0,0,0,0,0 /* 4A-4E */
.byte 0,0,0,0,0,0,0 /* 4F-55 */
.ascii "\\"
+ .fill 10,1,0
+
+ #elif defined(KBD_DVORAK)
+
+ key_map:
+ .byte 0,27
+ .ascii "1234567890\\="
+ .byte 127,9
+ .ascii "',.pyfgcrl/]"
+ .byte 13,0
+ .ascii "aoeuidhtns-"
+ .byte '`,0
+ .ascii "[;qjkxbmwvz"
+ .byte 0,'*,0,32 /* 36-39 */
+ .fill 16,1,0 /* 3A-49 */
+ .byte '-,0,0,0,'+ /* 4A-4E */
+ .byte 0,0,0,0,0,0,0 /* 4F-55 */
+ .byte '<
+ .fill 10,1,0
+
+ shift_map:
+ .byte 0,27
+ .ascii "!@#$%^&*()|+"
+ .byte 127,9
+ .ascii "\"<>PYFGCRL?}"
+ .byte 13,0
+ .ascii "AOEUIDHTNS_"
+ .byte '~,0
+ .ascii "{:QJKXBMWVZ"
+ .byte 0,'*,0,32 /* 36-39 */
+ .fill 16,1,0 /* 3A-49 */
+ .byte '-,0,0,0,'+ /* 4A-4E */
+ .byte 0,0,0,0,0,0,0 /* 4F-55 */
+ .byte '>
+ .fill 10,1,0
+
+ alt_map:
+ .byte 0,0
+ .ascii "\0@\0$\0\0{[]}\\\0"
+ .byte 0,0
+ .byte 0,0,0,0,0,0,0,0,0,0,0
+ .byte '~,13,0
+ .byte 0,0,0,0,0,0,0,0,0,0,0
+ .byte 0,0
+ .byte 0,0,0,0,0,0,0,0,0,0,0
+ .byte 0,0,0,0 /* 36-39 */
+ .fill 16,1,0 /* 3A-49 */
+ .byte 0,0,0,0,0 /* 4A-4E */
+ .byte 0,0,0,0,0,0,0 /* 4F-55 */
+ .byte '|
.fill 10,1,0
#else

BIN
bin/elf.ps.gz Normal file

Binary file not shown.

100
bin/fdformat.c Normal file
View File

@@ -0,0 +1,100 @@
/* fdformat.c - Low-level formats a floppy disk. */
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/fd.h>
static int ctrl;
struct floppy_struct param;
#define SECTOR_SIZE 512
#define PERROR(msg) { perror(msg); exit(1); }
static void format_disk(char *name)
{
struct format_descr descr;
int track;
char dummy;
printf("Formatting ... ");
fflush(stdout);
if (ioctl(ctrl,FDFMTBEG,NULL) < 0) PERROR("\nioctl(FDFMTBEG)");
for (track = 0; track < param.track; track++) {
descr.track = track;
descr.head = 0;
if (ioctl(ctrl,FDFMTTRK,(int) &descr) < 0) PERROR("\nioctl(FDFMTTRK)");
printf("%3d\b\b\b",track);
fflush(stdout);
if (param.head == 2) {
descr.head = 1;
if (ioctl(ctrl,FDFMTTRK,(int) &descr) < 0)
PERROR("\nioctl(FDFMTTRK)");
}
}
if (ioctl(ctrl,FDFMTEND,NULL) < 0) PERROR("\nioctl(FDFMTEND)");
printf("done\n");
}
static void verify_disk(char *name)
{
unsigned char *data;
int fd,cyl_size,cyl,count;
cyl_size = param.sect*param.head*512;
if ((data = (unsigned char *) malloc(cyl_size)) == NULL) PERROR("malloc");
printf("Verifying ... ");
fflush(stdout);
if ((fd = open(name,O_RDONLY)) < 0) PERROR(name);
for (cyl = 0; cyl < param.track; cyl++) {
printf("%3d\b\b\b",cyl);
fflush(stdout);
if (read(fd,data,cyl_size) != cyl_size) PERROR("read");
for (count = 0; count < cyl_size; count++)
if (data[count] != FD_FILL_BYTE) {
printf("bad data in cyl %d\nContinuing ... ",cyl);
fflush(stdout);
break;
}
}
printf("done\n");
if (close(fd) < 0) PERROR("close");
}
static void usage(char *name)
{
char *this;
if (this = strrchr(name,'/')) name = this+1;
fprintf(stderr,"usage: %s [ -n ] device\n",name);
exit(1);
}
main(int argc,char **argv)
{
int verify;
char *name;
name = argv[0];
verify = 1;
if (argc > 1 && argv[1][0] == '-') {
if (argv[1][1] != 'n') usage(name);
verify = 0;
argc--;
argv++;
}
if (argc != 2) usage(name);
if ((ctrl = open(argv[1],3)) < 0) PERROR(argv[1]);
if (ioctl(ctrl,FDGETPRM,(int) &param) < 0) PERROR("ioctl(FDGETPRM)");
printf("%sle-sided, %d tracks, %d sec/track. Total capacity %d kB.\n",
param.head ? "Doub" : "Sing",param.track,param.sect,param.size >> 1);
format_disk(argv[1]);
if (verify) verify_disk(argv[1]);
}

110
bin/fdisk.c Normal file
View File

@@ -0,0 +1,110 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <linux/hdreg.h>
#define DISK_STRING "/dev/hd"
static int current_minor;
static int indent;
char * disk_type(unsigned char type)
{
switch (type) {
case 1: return "12-bit DOS";
case 4: return "16-bit DOS (<32M)";
case 5: return "extended partition (don't use)";
case 6: return "16-bit DOS (>=32M)";
case 0x81: return "minix";
}
return NULL;
}
char * dev_name(int minor)
{
char * ctl;
static char name[100];
if (minor & 0x3f)
ctl = "%s%c%d";
else
ctl = "%s%c";
sprintf(name,ctl,DISK_STRING,'a'+(minor >> 6),minor & 0x3f);
return name;
}
void fdisk(int minor)
{
char * type, * name;
char buffer[1024];
struct partition * p;
int fd;
int i;
int this_minor = current_minor;
if ((fd=open(name = dev_name(minor),O_RDONLY)) < 0) {
fprintf(stderr,"Unable to open %s\n",name);
exit(1);
}
if (1024 != read(fd,buffer,1024))
return;
if (!(minor & 0x3f)) {
printf("Disk %d:\n", minor >> 6);
indent = 4;
}
p = (struct partition *) (buffer + 0x1be);
for (i=0 ; i<4 ; p++,i++) {
if (!p->nr_sects)
continue;
printf("%*c",indent,' ');
printf("%s: %6d blocks",dev_name(this_minor+i),p->nr_sects>>1);
if (p->boot_ind == 0x80)
printf(" active");
else if (p->boot_ind)
printf(" active? (%02x)",p->boot_ind);
if (type = disk_type(p->sys_ind))
printf(" %s\n",type);
else
printf(" unknown partition type 0x%02X\n",p->sys_ind);
if (p->sys_ind == 5 && (0x3f & current_minor) < 60) {
indent += 4;
current_minor += 4;
fdisk(this_minor+i);
indent -= 4;
}
}
/* check for disk-manager partitions */
if (*(unsigned short *) (buffer + 0xfc) != 0x55AA)
return;
p = (struct partition *) (buffer + 0x1be);
for (i=4; i<16; i++) {
p--;
if ((current_minor & 0x3f) >= 60)
break;
if (!p->nr_sects)
continue;
printf("%*c",indent,' ');
printf("%s: %6d blocks disk-manager",dev_name(current_minor),p->nr_sects>>1);
if (p->boot_ind == 0x80)
printf(" active");
else if (p->boot_ind)
printf(" active? (%02x)",p->boot_ind);
if (type = disk_type(p->sys_ind))
printf(" %s\n",type);
else
printf(" unknown partition type 0x%02X\n",p->sys_ind);
current_minor++;
}
}
int main(int argc, char ** argv)
{
current_minor = 1;
fdisk(0);
current_minor = 65;
fdisk(64);
return 0;
}

BIN
bin/file-1.25.tar.gz Normal file

Binary file not shown.

BIN
bin/flip1src.zip Normal file

Binary file not shown.

BIN
bin/fm.tar.gz Normal file

Binary file not shown.

645
bin/fsck.c Normal file
View File

@@ -0,0 +1,645 @@
/*
* fsck.c - a file system consistency checker for Linux.
*
* (C) 1991 Linus Torvalds. This file may be redistributed as per
* the Linux copyright.
*/
/*
* 09.11.91 - made the first rudimetary functions
*
* 10.11.91 - updated, does checking, no repairs yet.
* Sent out to the mailing-list for testing.
*
* 14.11.91 - Testing seems to have gone well. Added some
* correction-code, and changed some functions.
*
* 15.11.91 - More correction code. Hopefully it notices most
* cases now, and tries to do something about them.
*
* 16.11.91 - More corrections (thanks to Matti Jalava). Most
* things seem to work now.
*
* I've had no time to add comments - hopefully the function names
* are comments enough. As with all file system checkers, this assumes
* the file system is quiescent - don't use it on a mounted device
* unless you can be sure nobody is writing to it (and remember that the
* kernel can write to it when it searches for files).
*
* Usuage: fsck [-larvsm] device
* -l for a listing of all the filenames
* -a for automatic repairs (not implemented)
* -r for repairs (interactive) (not implemented)
* -v for verbose (tells how many files)
* -s for super-block info
* -m for minix-like "mode not cleared" warnings
*
* The device may be a block device or a image of one, but this isn't
* enforced (but it's not much fun on a character device :-).
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
#include <termios.h>
#include <sys/stat.h>
#include <linux/fs.h>
#ifndef __GNUC__
#error "needs gcc for the bitop-__asm__'s"
#endif
#ifndef __linux__
#define volatile
#endif
#define ROOT_INO 1
#define UPPER(size,n) ((size+((n)-1))/(n))
#define INODE_SIZE (sizeof(struct d_inode))
#define INODE_BLOCKS UPPER(INODES,INODES_PER_BLOCK)
#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)
#define BITS_PER_BLOCK (BLOCK_SIZE<<3)
static char * program_name = "fsck";
static char * device_name = NULL;
static int IN;
static int repair=0, automatic=0, verbose=0, list=0, show=0, warn_mode=0;
static int directory=0, regular=0, blockdev=0, chardev=0, links=0, total=0;
/* this is used to implement the (coming) two-pass zone checking. */
static int trust_zone_bit_map=0;
static int changed = 0; /* flags if the filesystem has been changed */
/* File-name data */
#define MAX_DEPTH 50
static int name_depth = 0;
static char name_list[MAX_DEPTH][NAME_LEN+1];
static char * inode_buffer = NULL;
#define Inode (((struct d_inode *) inode_buffer)-1)
static char super_block_buffer[BLOCK_SIZE];
#define Super (*(struct super_block *)super_block_buffer)
#define INODES ((unsigned long)Super.s_ninodes)
#define ZONES ((unsigned long)Super.s_nzones)
#define IMAPS ((unsigned long)Super.s_imap_blocks)
#define ZMAPS ((unsigned long)Super.s_zmap_blocks)
#define FIRSTZONE ((unsigned long)Super.s_firstdatazone)
#define ZONESIZE ((unsigned long)Super.s_log_zone_size)
#define MAXSIZE ((unsigned long)Super.s_max_size)
#define MAGIC (Super.s_magic)
#define NORM_FIRSTZONE (2+IMAPS+ZMAPS+INODE_BLOCKS)
static char inode_map[BLOCK_SIZE * I_MAP_SLOTS];
static char zone_map[BLOCK_SIZE * Z_MAP_SLOTS];
static unsigned char * inode_count = NULL;
static unsigned char * zone_count = NULL;
void recursive_check(unsigned int ino);
#define bitop(name,op) \
static inline int name(char * addr,unsigned int nr) \
{ \
int __res; \
__asm__("bt" op " %1,%2; adcl $0,%0" \
:"=g" (__res) \
:"r" (nr),"m" (*(addr)),"0" (0)); \
return __res; \
}
bitop(bit,"")
bitop(setbit,"s")
bitop(clrbit,"c")
#define inode_in_use(x) (bit(inode_map,(x)))
#define zone_in_use(x) (bit(zone_map,(x)-FIRSTZONE+1))
#define mark_inode(x) (setbit(inode_map,(x)),changed=1)
#define unmark_inode(x) (clrbit(inode_map,(x)),changed=1)
#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1),changed=1)
#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1)
/*
* Volatile to let gcc know that this doesn't return. When trying
* to compile this under minix, volatile gives a warning, as
* exit() isn't defined as volatile under minix.
*/
volatile void fatal_error(const char * fmt_string)
{
fprintf(stderr,fmt_string,program_name,device_name);
exit(1);
}
#define usage() fatal_error("Usage: %s [-larvsm] /dev/name\n")
#define die(str) fatal_error("%s: " str "\n")
/*
* This simply goes through the file-name data and prints out the
* current file.
*/
void print_current_name(void)
{
int i=0;
while (i<name_depth)
printf("/%.14s",name_list[i++]);
}
int ask(const char * string,int def)
{
int c;
if (!repair) {
printf("\n");
return 0;
}
if (automatic) {
printf("\n");
return def;
}
printf(def?"%s (y/n)? ":"%s (n/y)? ",string);
for (;;) {
fflush(stdout);
if ((c=getchar())==EOF)
return def;
c=toupper(c);
if (c == 'Y') {
def = 1;
break;
} else if (c == 'N') {
def = 0;
break;
} else if (c == ' ' || c == '\n')
break;
}
if (def)
printf("y\n");
else
printf("n\n");
return def;
}
/*
* check_zone_nr checks to see that *nr is a valid zone nr. If it
* isn't, it will possibly be repaired. Check_zone_nr returns != 0
* if it changed the nr.
*/
int check_zone_nr(unsigned short * nr)
{
if (!*nr)
return 0;
if (*nr < FIRSTZONE)
printf("Zone nr < FIRSTZONE in file `");
else if (*nr >= ZONES)
printf("Zone nr > ZONES in file `");
else
return 0;
print_current_name();
printf("'.");
if (ask("Remove block",1)) {
*nr=0;
changed = 1;
return 1;
}
return 0;
}
/*
* read-block reads block *nr into the buffer at addr. It returns
* 0 if the *nr is unchanged, 1 if it was changed.
*/
int read_block(unsigned short * nr, char * addr)
{
int blk_chg = check_zone_nr(nr);
if (!*nr || *nr >= ZONES) {
memset(addr,0,BLOCK_SIZE);
return changed;
}
if (BLOCK_SIZE*(*nr) != lseek(IN, BLOCK_SIZE*(*nr), SEEK_SET))
die("seek failed in read_block");
if (BLOCK_SIZE != read(IN, addr, BLOCK_SIZE)) {
printf("Read error: bad block in file '");
print_current_name();
printf("'\n");
memset(addr,0,BLOCK_SIZE);
}
return blk_chg;
}
/*
* write_block writes block nr to disk.
*/
inline void write_block(unsigned int nr, char * addr)
{
if (!nr)
return;
if (nr < FIRSTZONE || nr >= ZONES) {
printf("Internal error: trying to write bad block\n"
"Write request ignored\n");
return;
}
if (BLOCK_SIZE*nr != lseek(IN, BLOCK_SIZE*nr, SEEK_SET))
die("seek failed in write_block");
if (BLOCK_SIZE != write(IN, addr, BLOCK_SIZE)) {
printf("Write error: bad block in file '");
print_current_name();
printf("'\n");
}
}
/*
* mapped-read-block reads block nr blknr from the specified file.
* it returns 1 if the inode has been changed due to bad zone nrs
*/
inline int mapped_read_block(struct d_inode * inode,
unsigned int blknr, char * addr)
{
unsigned short ind[BLOCK_SIZE>>1];
unsigned short dind[BLOCK_SIZE>>1];
int result;
if (blknr<7)
return read_block(blknr + inode->i_zone,addr);
blknr -= 7;
if (blknr<512) {
result = read_block(7 + inode->i_zone, (char *) ind);
if (read_block(blknr + ind,addr))
write_block(inode->i_zone[7], (char *) ind);
return result;
}
blknr -= 512;
result = read_block(8 + inode->i_zone, (char *) dind);
if (read_block(blknr/512 + dind, (char *) ind))
write_block(inode->i_zone[8], (char *) dind);
if (read_block(blknr%512 + ind,addr))
write_block(dind[blknr/512], (char *) ind);
return result;
}
void write_tables(void)
{
if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
die("seek failed in write_tables");
if (BLOCK_SIZE != write(IN, super_block_buffer, BLOCK_SIZE))
die("unable to write super-block");
if (IMAPS*BLOCK_SIZE != write(IN,inode_map,IMAPS*BLOCK_SIZE))
die("Unable to write inode map");
if (ZMAPS*BLOCK_SIZE != write(IN,zone_map,ZMAPS*BLOCK_SIZE))
die("Unable to write zone map");
if (INODE_BUFFER_SIZE != write(IN,inode_buffer,INODE_BUFFER_SIZE))
die("Unable to write inodes");
}
void read_tables(void)
{
memset(inode_map,0,sizeof(inode_map));
memset(zone_map,0,sizeof(zone_map));
if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
die("seek failed");
if (BLOCK_SIZE != read(IN, super_block_buffer, BLOCK_SIZE))
die("unable to read super block");
if (MAGIC != SUPER_MAGIC)
die("bad magic number in super-block");
if (ZONESIZE != 0 || BLOCK_SIZE != 1024)
die("Only 1k blocks/zones supported");
if (!IMAPS || IMAPS > I_MAP_SLOTS)
die("bad s_imap_blocks field in super-block");
if (!ZMAPS || ZMAPS > Z_MAP_SLOTS)
die("bad s_zmap_blocks field in super-block");
inode_buffer = malloc(INODE_BUFFER_SIZE);
if (!inode_buffer)
die("Unable to allocate buffer for inodes");
inode_count = malloc(INODES);
if (!inode_count)
die("Unable to allocate buffer for inode count");
zone_count = malloc(ZONES);
if (!zone_count)
die("Unable to allocate buffer for zone count");
if (IMAPS*BLOCK_SIZE != read(IN,inode_map,IMAPS*BLOCK_SIZE))
die("Unable to read inode map");
if (ZMAPS*BLOCK_SIZE != read(IN,zone_map,ZMAPS*BLOCK_SIZE))
die("Unable to read zone map");
if (INODE_BUFFER_SIZE != read(IN,inode_buffer,INODE_BUFFER_SIZE))
die("Unable to read inodes");
if (NORM_FIRSTZONE != FIRSTZONE)
printf("Warning: Firstzone != Norm_firstzone\n");
if (show) {
printf("%d inodes\n",INODES);
printf("%d blocks\n",ZONES);
printf("Firstdatazone=%d (%d)\n",FIRSTZONE,NORM_FIRSTZONE);
printf("Zonesize=%d\n",BLOCK_SIZE<<ZONESIZE);
printf("Maxsize=%d\n\n",MAXSIZE);
}
}
struct d_inode * get_inode(unsigned int nr)
{
struct d_inode * inode;
if (!nr || nr > INODES)
return NULL;
total++;
inode = Inode + nr;
if (!inode_count[nr]) {
if (!inode_in_use(nr)) {
printf("Inode %d marked not used, but used for file '",
nr);
print_current_name();
printf("'\n");
if (repair)
if (ask("Mark in use",1))
mark_inode(nr);
}
if (S_ISDIR(inode->i_mode))
directory++;
else if (S_ISREG(inode->i_mode))
regular++;
else if (S_ISCHR(inode->i_mode))
chardev++;
else if (S_ISBLK(inode->i_mode))
blockdev++;
} else
links++;
if (!++inode_count[nr]) {
printf("Warning: inode count too big.\n");
inode_count[nr]--;
}
return inode;
}
void check_root(void)
{
struct d_inode * inode = Inode + ROOT_INO;
if (!inode || !S_ISDIR(inode->i_mode))
die("root inode isn't a directory");
}
static int add_zone(unsigned short * znr)
{
int result;
result=check_zone_nr(znr);
if (!*znr || *znr >= ZONES)
return result;
if (zone_count[*znr]) {
printf("Block has been used before. Now in file `");
print_current_name();
printf("'.");
if (ask("Clear",1)) {
*znr = 0;
changed = 1;
}
}
if (!*znr || *znr >= ZONES)
return result;
if (!zone_in_use(*znr)) {
printf("Block %d in file `",*znr);
print_current_name();
printf("' is marked not in use.");
if (ask("Correct",1))
mark_zone(*znr);
}
if (!++zone_count[*znr])
zone_count[*znr]--;
return result;
}
static int add_zone_ind(unsigned short * znr)
{
static char blk[BLOCK_SIZE];
int i, result, chg_blk=0;
result = add_zone(znr);
if (!*znr || *znr>=ZONES)
return result;
read_block(znr,blk);
for (i=0 ; i < (BLOCK_SIZE>>1) ; i++)
chg_blk |= add_zone(i + (unsigned short *) blk);
if (chg_blk)
write_block(*znr,blk);
return result;
}
static int add_zone_dind(unsigned short * znr)
{
static char blk[BLOCK_SIZE];
int i, result, blk_chg=0;
result = add_zone(znr);
if (!*znr || *znr >= ZONES)
return result;
read_block(znr,blk);
for (i=0 ; i < (BLOCK_SIZE>>1) ; i++)
blk_chg |= add_zone_ind(i + (unsigned short *) blk);
if (blk_chg)
write_block(*znr,blk);
return result;
}
void check_zones(unsigned int i)
{
struct d_inode * inode;
if (!i || i >= INODES)
return;
if (inode_count[i] > 1) /* have we counted this file already? */
return;
inode = Inode + i;
if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode))
return;
for (i=0 ; i<7 ; i++)
add_zone(i + inode->i_zone);
add_zone_ind(7 + inode->i_zone);
add_zone_dind(8 + inode->i_zone);
}
void check_file(struct d_inode * dir, unsigned int offset)
{
static char blk[BLOCK_SIZE];
struct d_inode * inode;
int ino;
char * name;
changed |= mapped_read_block(dir,offset/BLOCK_SIZE,blk);
name = blk + (offset % BLOCK_SIZE) + 2;
ino = * (unsigned short *) (name-2);
inode = get_inode(ino);
if (!offset)
if (!inode || strcmp(".",name)) {
print_current_name();
printf(": bad directory: '.' isn't first\n");
} else return;
if (offset == 16)
if (!inode || strcmp("..",name)) {
print_current_name();
printf(": bad directory: '..' isn't second\n");
} else return;
if (!inode)
return;
if (name_depth < MAX_DEPTH)
strncpy(name_list[name_depth],name,14);
name_depth++;
if (list) {
if (verbose)
printf("%6d %07o ",ino,inode->i_mode);
print_current_name();
if (S_ISDIR(inode->i_mode))
printf(":\n");
else
printf("\n");
}
check_zones(ino);
if (inode && S_ISDIR(inode->i_mode))
recursive_check(ino);
name_depth--;
return;
}
void recursive_check(unsigned int ino)
{
struct d_inode * dir;
unsigned int offset;
dir = Inode + ino;
if (!S_ISDIR(dir->i_mode))
die("internal error");
for (offset = 0 ; offset < dir->i_size ; offset += 16)
check_file(dir,offset);
}
void check_counts(void)
{
int i;
for (i=1 ; i < INODES ; i++) {
if (!inode_in_use(i) && Inode[i].i_mode && warn_mode) {
printf("Inode %d mode not cleared.",i);
if (ask("Clear",1)) {
Inode[i].i_mode = 0;
changed = 1;
}
}
if (inode_in_use(i)*Inode[i].i_nlinks == inode_count[i])
continue;
if (!inode_count[i]) {
printf("Inode %d not used, marked used in the bitmap.",
i);
if (ask("Clear",1))
unmark_inode(i);
} else if (!inode_in_use(i)) {
printf("Inode %d used, marked unused in the bitmap.",
i);
if (ask("Set",1))
mark_inode(i);
}
if (inode_in_use(i) && Inode[i].i_nlinks != inode_count[i]) {
printf("Inode %d, i_nlinks=%d, counted=%d.",
i,Inode[i].i_nlinks,inode_count[i]);
if (ask("Set i_nlinks to count",1)) {
Inode[i].i_nlinks=inode_count[i];
changed=1;
}
}
}
for (i=FIRSTZONE ; i < ZONES ; i++) {
if (zone_in_use(i) == zone_count[i])
continue;
printf("Zone %d: %s in use, counted=%d\n",
i,zone_in_use(i)?"":"not",zone_count[i]);
}
}
void check(void)
{
memset(inode_count,0,INODES*sizeof(*inode_count));
memset(zone_count,0,ZONES*sizeof(*zone_count));
check_zones(ROOT_INO);
recursive_check(ROOT_INO);
check_counts();
}
int main(int argc, char ** argv)
{
struct termios termios,tmp;
if (argc && *argv)
program_name = *argv;
if (INODE_SIZE * INODES_PER_BLOCK != BLOCK_SIZE)
die("bad inode size");
while (argc-- > 1) {
argv++;
if (argv[0][0] != '-')
if (device_name)
usage();
else
device_name = argv[0];
else while (*++argv[0])
switch (argv[0][0]) {
case 'l': list=1; break;
case 'a': automatic=1; repair=1; break;
case 'r': automatic=0; repair=1; break;
case 'v': verbose=1; break;
case 's': show=1; break;
case 'm': warn_mode=1; break;
default: usage();
}
}
if (!device_name)
usage();
if (repair && !automatic) {
if (!isatty(0) || !isatty(1))
die("need terminal for interactive repairs");
tcgetattr(0,&termios);
tmp = termios;
tmp.c_lflag &= ~(ICANON|ECHO);
tcsetattr(0,TCSANOW,&tmp);
}
IN = open(device_name,repair?O_RDWR:O_RDONLY);
if (IN < 0)
die("unable to open '%s'");
read_tables();
check_root();
check();
if (verbose) {
int i, free;
for (i=1,free=0 ; i<INODES ; i++)
if (!inode_in_use(i))
free++;
printf("\n%6d inodes used (%d%%)\n",(INODES-free),
100*(INODES-free)/INODES);
for (i=FIRSTZONE,free=0 ; i<ZONES ; i++)
if (!zone_in_use(i))
free++;
printf("%6d zones used (%d%%)\n",(ZONES-free),
100*(ZONES-free)/ZONES);
printf("\n%6d regular files\n"
"%6d directories\n"
"%6d character device files\n"
"%6d block device files\n"
"%6d links\n"
"------\n"
"%6d files\n",
regular,directory,chardev,blockdev,
links-2*directory+1,total-2*directory+1);
}
if (changed) {
write_tables();
printf( "----------------------------\n"
"FILE SYSTEM HAS BEEN CHANGED\n"
"----------------------------\n");
}
if (repair && !automatic)
tcsetattr(0,TCSANOW,&termios);
return (0);
}

329
bin/gawk-diffs Normal file
View File

@@ -0,0 +1,329 @@
*** 1.1 1991/12/11 16:13:13
--- Makefile 1991/12/11 17:07:11
***************
*** 64,71 ****
# MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DSTRERROR_MISSING -DRANDOM_MISSING
# VAX running Ultrix 3.x
- MISSING = -DSTRERROR_MISSING
# A generic 4.2 BSD machine
# (eliminate GETOPT_MISSING for 4.3 release)
# (eliminate STRCASE_MISSING and TMPNAM_MISSING for Tahoe release)
--- 64,75 ----
# MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DSTRERROR_MISSING -DRANDOM_MISSING
# VAX running Ultrix 3.x
+ # LINUX
+ MISSING = -DSPRINTF_INT -DTMPNAM_MISSING -DBLKSIZE_MISSING -DSTRCASE_MISSING \
+ -Dalloca=__builtin_alloca -DGCVT_MISSING -DRANDOM_MISSING \
+ -DBCOPY_MISSING -DSTRTOD_MISSING
+
# A generic 4.2 BSD machine
# (eliminate GETOPT_MISSING for 4.3 release)
# (eliminate STRCASE_MISSING and TMPNAM_MISSING for Tahoe release)
***************
*** 80,92 ****
# Comment out the next line if you don't have gcc.
# Also choose just one of -g and -O.
! #CC= gcc
! #OPTIMIZE= -O -g
PROFILE= #-pg
DEBUG= #-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
DEBUGGER= #-g -Bstatic
! WARN= #-W -Wunused -Wimplicit -Wreturn-type -Wcomment # for gcc only
# Parser to use on grammar -- if you don't have bison use the first one
#PARSER = yacc
--- 84,96 ----
# Comment out the next line if you don't have gcc.
# Also choose just one of -g and -O.
! CC= gcc
! OPTIMIZE= -O #-g
PROFILE= #-pg
DEBUG= #-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
DEBUGGER= #-g -Bstatic
! WARN= -W -Wunused -Wimplicit -Wreturn-type -Wcomment # for gcc only
# Parser to use on grammar -- if you don't have bison use the first one
#PARSER = yacc
***************
*** 154,160 ****
# rules to build gawk
gawk: $(ALLOBJS) $(GNUOBJS)
! $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) -lm
$(AWKOBJS): awk.h
--- 158,164 ----
# rules to build gawk
gawk: $(ALLOBJS) $(GNUOBJS)
! $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) #-lm
$(AWKOBJS): awk.h
*** 1.1 1991/12/11 16:18:17
--- awk.h 1991/12/11 17:07:45
***************
*** 42,51 ****
extern char *alloca();
#endif
#else
extern char *alloca();
#endif
#ifdef SPRINTF_INT
! extern int sprintf();
#else /* not USG */
/* nasty nasty berkelixm */
#define setjmp _setjmp
--- 42,53 ----
extern char *alloca();
#endif
#else
+ #ifndef alloca
extern char *alloca();
#endif
+ #endif
#ifdef SPRINTF_INT
! /* extern int sprintf(); XXX LINUX */
#else /* not USG */
/* nasty nasty berkelixm */
#define setjmp _setjmp
***************
*** 78,99 ****
extern char *memset(char *, int, int);
/* extern int fprintf(FILE *, char *, ...); */
! extern int fprintf();
extern int vfprintf();
#ifndef MSDOS
! extern int fwrite(char *, int, int, FILE *);
#endif
extern int fflush(FILE *);
extern int fclose(FILE *);
extern int pclose(FILE *);
#ifndef MSDOS
! extern int fputs(char *, FILE *);
#endif
extern void abort();
extern int isatty(int);
extern void exit(int);
extern int system(char *);
extern int sscanf(/* char *, char *, ... */);
extern double atof(char *);
extern int fstat(int, struct stat *);
--- 80,104 ----
extern char *memset(char *, int, int);
/* extern int fprintf(FILE *, char *, ...); */
! /* extern int fprintf(); XXXL */
extern int vfprintf();
#ifndef MSDOS
! /* extern int fwrite(char *, int, int, FILE *); XXXL */
#endif
extern int fflush(FILE *);
extern int fclose(FILE *);
extern int pclose(FILE *);
#ifndef MSDOS
! /* extern int fputs(char *, FILE *); XXXL */
#endif
extern void abort();
extern int isatty(int);
extern void exit(int);
extern int system(char *);
+ #if 0
+ /* XXXL */
extern int sscanf(/* char *, char *, ... */);
+ #endif
extern double atof(char *);
extern int fstat(int, struct stat *);
***************
*** 100,110 ****
extern off_t lseek(int, off_t, int);
extern int fseek(FILE *, long, int);
extern int close(int);
! extern int open();
extern int pipe(int *);
extern int dup2(int, int);
#ifndef MSDOS
! extern int unlink(char *);
#endif
extern int fork();
extern int execl(/* char *, char *, ... */);
--- 105,115 ----
extern off_t lseek(int, off_t, int);
extern int fseek(FILE *, long, int);
extern int close(int);
! /* extern int open(); XXXL */
extern int pipe(int *);
extern int dup2(int, int);
#ifndef MSDOS
! /* extern int unlink(char *); XXXL */
#endif
extern int fork();
extern int execl(/* char *, char *, ... */);
*** 1.1 1991/12/11 16:29:17
--- awk.y 1991/12/11 17:08:04
***************
*** 96,102 ****
%type <sval> func_name
%token <sval> FUNC_CALL NAME REGEXP
! %token <lval> ERROR
%token <nodeval> NUMBER YSTRING
%token <nodetypeval> RELOP APPEND_OP
%token <nodetypeval> ASSIGNOP MATCHOP NEWLINE CONCAT_OP
--- 96,102 ----
%type <sval> func_name
%token <sval> FUNC_CALL NAME REGEXP
! %token <lval> ERROR_TOK
%token <nodeval> NUMBER YSTRING
%token <nodetypeval> RELOP APPEND_OP
%token <nodetypeval> ASSIGNOP MATCHOP NEWLINE CONCAT_OP
***************
*** 386,401 ****
nls
: NEWLINE
! { $<nodetypeval>$ = NULL; }
| nls NEWLINE
! { $<nodetypeval>$ = NULL; }
;
opt_nls
: /* empty */
! { $<nodetypeval>$ = NULL; }
| nls
! { $<nodetypeval>$ = NULL; }
;
input_redir
--- 386,401 ----
nls
: NEWLINE
! { $<nodetypeval>$ = (NODETYPE) NULL; }
| nls NEWLINE
! { $<nodetypeval>$ = (NODETYPE) NULL; }
;
opt_nls
: /* empty */
! { $<nodetypeval>$ = (NODETYPE) NULL; }
| nls
! { $<nodetypeval>$ = (NODETYPE) NULL; }
;
input_redir
***************
*** 953,959 ****
case '\\':
if (*lexptr++ == '\0') {
yyerror("unterminated regexp ends with \\");
! return ERROR;
} else if (lexptr[-1] == '\n')
goto retry;
break;
--- 953,959 ----
case '\\':
if (*lexptr++ == '\0') {
yyerror("unterminated regexp ends with \\");
! return ERROR_TOK;
} else if (lexptr[-1] == '\n')
goto retry;
break;
***************
*** 969,975 ****
case '\0':
lexptr--; /* so error messages work */
yyerror("unterminated regexp");
! return ERROR;
}
}
}
--- 969,975 ----
case '\0':
lexptr--; /* so error messages work */
yyerror("unterminated regexp");
! return ERROR_TOK;
}
}
}
***************
*** 1163,1169 ****
case '\n':
lexptr--;
yyerror("unterminated string");
! return ERROR;
case '"':
yylval.nodeval = make_str_node(tokstart + 1,
lexptr-tokstart-2, esc_seen);
--- 1163,1169 ----
case '\n':
lexptr--;
yyerror("unterminated string");
! return ERROR_TOK;
case '"':
yylval.nodeval = make_str_node(tokstart + 1,
lexptr-tokstart-2, esc_seen);
***************
*** 1171,1177 ****
return YSTRING;
}
}
! return ERROR;
case '-':
if (*lexptr == '=') {
--- 1171,1177 ----
return YSTRING;
}
}
! return ERROR_TOK;
case '-':
if (*lexptr == '=') {
***************
*** 1256,1262 ****
}
return LEX_AND;
}
! return ERROR;
case '|':
if (*lexptr == '|') {
--- 1256,1262 ----
}
return LEX_AND;
}
! return ERROR_TOK;
case '|':
if (*lexptr == '|') {
***************
*** 1279,1285 ****
if (c != '_' && ! isalpha(c)) {
yyerror("Invalid char '%c' in expression\n", c);
! return ERROR;
}
/* it's some type of name-type-thing. Find its length */
--- 1279,1285 ----
if (c != '_' && ! isalpha(c)) {
yyerror("Invalid char '%c' in expression\n", c);
! return ERROR_TOK;
}
/* it's some type of name-type-thing. Find its length */

BIN
bin/getty_ps-2.0.7j.tar.gz Normal file

Binary file not shown.

27
bin/hostname.c Normal file
View File

@@ -0,0 +1,27 @@
/*
* Set or display hostname. Jeff Comstock - Bloomington, MN USA 1992
* Usage: hostname [name]
* Only root may change the hostname.
*/
#include <stdio.h>
#include <unistd.h>
main(int argc, char **argv) {
struct utsname uts;
if ( argc == 2 ) {
if ( sethostname(argv[1],strlen(argv[1]))) {
perror("sethostname");
exit(1);
}
}
else {
if (uname(&uts)) {
perror("uname");
exit(1);
}
else
puts(uts.nodename);
}
return(0);
}

BIN
bin/joe.tar.gz Normal file

Binary file not shown.

34
bin/keyboard_rate.patch Normal file
View File

@@ -0,0 +1,34 @@
From: johnsonm@stolaf.edu (Michael K. Johnson)
Subject: changing keyboard repeat rate.
OK, I have gotten several requests for info on how to change the
keyboard repeat rate, so here goes. Note: I can't just give diffs,
because there are lots of options, and for heaven's sake it's only
three lines of code.
In boot/setup.S, there are the lines:
! set the keyboard repeat rate to the max
mov ax,#0x0305
mov bx,0x0000
int 0x16
If you don't want to change the repeat rate at all, just comment out
these lines by prefacing them with !'s. If you want something in the
middle, change the
mov bx,0x0000
to mov bx,0x????
where ???? is determined by (from Ralf Brown's interrupt list)
bh = delay value (0x00 = 250 ms to 0x03 = 1000 ms (one second))
this is the delay before the repeat starts happening
bl = repeat rate (0x00 = 30/sec to 0x0c = 10/sec [default] to 0x1f = 2/sec)
I use mov bx,0x0006
to delay 1/4 sec, then repeat at what I think is a comfortable rate.
I am too lazy to calculate the exact speed -- maybe 20/sec? ;-)
Hope this helps people.
michaelkjohnson
johnsonm@stolaf.edu

41
bin/larix-1.README Normal file
View File

@@ -0,0 +1,41 @@
----------------------- LARIX -----------------------------------
Larix means "Load And Run In Kernel Space". It allows dynamic
additions to the kernel. As an example I've edited the bus mouse
driver and the MSDOS filesystem to be loaded in this way.
If Linus likes it enough to include into the standard kernel,
I'll rewrite all other devices too. This way if you are working
on a device driver, you can simply unload the standard device
driver, and load your own. No more kernel relinking, no more
reboots.
This is the first version that is going out on the net. I probably
forgot some file, so the first to report that a file is missing is
offered a fee update ! :-)
The file is packaged as a context diff, which you can apply to
your linux 0.97 pl4 kernel by typing something like
zcat larix.diffs.Z |patch -p0
in the /usr/src directory. (as always, make a backup of the
original, in case something goes wrong.)
This package also uses a general purpose kernel malloc routine.
So your device drivers may use those too if they need them.
Do note that the "users" of this kernel malloc routine are responsible
for preventing fragmentation. So don't allocate very many very small
blocks of memory unless you intend to free them all at once.
Bugs, bug fixes, and questions may be directed to me:
email: wolff@duteca.et.tudelft.nl.
or: Roger Wolff
Oosterstraat 23
2611 TT Delft
Holland
Tel ()31-15-142371
Roger.

22
bin/larix-2.README Normal file
View File

@@ -0,0 +1,22 @@
Larix - Load and run in kernel space.
Suggested for all working on device drivers or filesystems.
This is also helpful for people who are working on modifying one
specific system call.
This can be considered as an alpha testing release, although I'm more
or less finished with it. (i.e. I'd put it in a alpha testing directory)
The file contains manuals.
Bugs, questions etc. can be sent to me:
wolff@dutecai.et.tudelft.nl,
Roger Wolff
Oosterstraat 23
2611 TT Delft
Holland.

114
bin/lastlogin.c Normal file
View File

@@ -0,0 +1,114 @@
/***************************************************************************
* Program: lastlogin (c)1987 ICUS Computer Group *
* By: Lenny Tropiano ...{ihnp4,mtune}!icus!lenny *
* *
* Program intent: This will allow programs like 'finger' and 'last' to *
* lookup in the file /usr/adm/lastlogin.log and see *
* when a particular user has logged-in. This saves *
* the necessity to keep /etc/wtmp around for a long *
* period of time. *
* *
* This program can be used/modified and redistributed *
* I declare it PUBLIC DOMAIN. Please give me credit *
* when credit is due. *
* *
* AT&T 3B1 compiling instructions for shared-libaries: *
* *
* $ cc -c -O lastlogin.c *
* $ ld -s -o lastlogin lastlogin.o /lib/shlib.ifile /lib/crt0s.o *
* $ mv lastlogin /etc *
* $ su *
* Password: *
* # chown adm /etc/lastlogin /usr/adm *
* # chgrp adm /etc/lastlogin /usr/adm *
* # chmod 4755 /etc/lastlogin *
* *
* Place a call to /etc/lastlogin in your /etc/localprofile *
* to be run on all user logins. *
***************************************************************************/
/***************************************************************************
* Linux compiling instructions: *
* *
* $ gcc -o lastlogin lastlogin.c utmp2.o *
* utmp2.o is compiled from poe-IGL (1.2) *
* $ mv lastlogin /etc *
* $ su *
* Password: *
* # chown adm /etc/lastlogin /usr/adm *
* # chgrp adm /etc/lastlogin /usr/adm *
* # chmod 4755 /etc/lastlogin *
* *
* Place a call to /etc/lastlogin in your /etc/profile *
* to be run on all user logins. *
* *
* B.Bergt@informatik.tu-chemnitz.de *
***************************************************************************/
/* Print the last login time and record the new time */
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <utmp.h>
#define LOGFILE "/usr/adm/lastlog"
main()
{
struct utmp *utent, *getutent();
int fd;
long hrs, min, sec;
struct lastlog {
char ll_line[8];
time_t ll_time;
} ll;
if (access(LOGFILE, 0) == -1) {
if ((fd = creat(LOGFILE,0644)) == -1) {
fprintf(stderr,"Cannot create file %s: ", LOGFILE);
perror("creat()");
exit(1);
}
} else {
if ((fd = open(LOGFILE,O_RDWR)) == -1) {
fprintf(stderr,"Cannot open file %s: ", LOGFILE);
perror("open()");
exit(1);
}
}
if (lseek(fd, (long)(getuid()*sizeof(struct lastlog)), 0) == -1) {
fprintf(stderr,"Cannot position file %s: ", LOGFILE);
perror("lseek()");
exit(1);
}
if (read(fd, (char *) &ll, sizeof ll) == sizeof ll &&
ll.ll_time != 0L) {
printf("Last login: %.*s on %.*s\n" , 19
, (char *) ctime(&ll.ll_time) , sizeof(ll.ll_line)
, ll.ll_line);
} else printf("Last login: [No Login information on record]\n");
sprintf(ll.ll_line, "%.8s", strrchr(ttyname(0), '/')+1);
setutent();
while ((utent = getutent()) != NULL)
if (strcmp(utent->ut_line, ll.ll_line) == 0)
break;
if (utent == NULL) {
fprintf(stderr,"Cannot locate utmp entry for tty\n");
exit(1);
}
ll.ll_time = utent->ut_time;
endutent();
lseek(fd, (long)(getuid()*sizeof(struct lastlog)), 0);
write(fd, (char *) &ll, sizeof ll);
close(fd);
exit(0);
}

Binary file not shown.

BIN
bin/lha-1.00.tar.gz Normal file

Binary file not shown.

11
bin/lha.Linux.README Normal file
View File

@@ -0,0 +1,11 @@
This archive contains a Executable of LHA and an archive with the source
and the addapted Makefile so one can compile under Linux.
I (The Sender of this File) would like to see this archive added to the
archive of Linux Programs.
I hope it is of any use to someone out there!
For any questions I'm reacheable by E-Mail under
m2c6@sci.kun.nl (At least until June 1992).

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/linux-bins-0.2.tar.gz Normal file

Binary file not shown.

73365
bin/ls-lR Normal file

File diff suppressed because it is too large Load Diff

BIN
bin/m4.tar.gz Normal file

Binary file not shown.

BIN
bin/man-1.0.tar.gz Normal file

Binary file not shown.

BIN
bin/mg Normal file

Binary file not shown.

BIN
bin/mg.tar.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/mkswap Normal file

Binary file not shown.

44
bin/mtools/mtools_Readme Normal file
View File

@@ -0,0 +1,44 @@
This is the Mtools v2.0 distribution package. Mtools is a public domain
collection of programs to allow Unix systems to read, write, and
manipulate files on an MSDOS filesystem (typically a diskette).
The following MSDOS commands are emulated:
Mtool MSDOS
name equivalent Description
----- ---- -----------
mattrib ATTRIB change MSDOS file attribute flags
mcd CD change MSDOS directory
mcopy COPY copy MSDOS files to/from Unix
mdel DEL/ERASE delete an MSDOS file
mdir DIR display an MSDOS directory
mformat FORMAT add MSDOS filesystem to a low-level format
mlabel LABEL make an MSDOS volume label.
mmd MD/MKDIR make an MSDOS subdirectory
mrd RD/RMDIR remove an MSDOS subdirectory
mread COPY low level read (copy) an MSDOS file to Unix
mren REN/RENAME rename an existing MSDOS file
mtype TYPE display contents of an MSDOS file
mwrite COPY low level write (copy) a Unix file to MSDOS
Here are what the files should look like:
file name length att sum bsd sum
mtools_patches1-5.Z 43331 01381 04887
mtools_sh.1.Z 27527 34726 38082
mtools_sh.2.Z 26902 17097 42191
mtools_sh.3.Z 16327 04558 20371
mtools_sh.4.Z 10405 51165 39152
The 'mtools_patches1-5' file is for those people who already have Mtools
version 2.0, but are missing one or more of the patches. The 'mtools_sh.*'
files already have the patches installed. The last file 'mtools_sh.4' is
optional... it contains the formatted output of the manual pages for the
benefit of those without nroff.
Emmet P. Gray US Army, HQ III Corps & Fort Hood
...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV
fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing
Environmental Management Office
Fort Hood, TX 76544-5057

BIN
bin/mush.tar Normal file

Binary file not shown.

0
bin/mush.tar.gz Normal file
View File

BIN
bin/nasm-0.98.tar.gz Normal file

Binary file not shown.

BIN
bin/old-bin-0.1x/mkswap Normal file

Binary file not shown.

BIN
bin/old/bash-1.05.tar Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
1.05

249
bin/old/bash-1.05/COPYING Normal file
View File

@@ -0,0 +1,249 @@
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!

279
bin/old/bash-1.05/ChangeLog Normal file
View File

@@ -0,0 +1,279 @@
Sun Mar 11 04:28:30 1990 Brian Fox (bfox at gnuwest.fsf.org)
* parse.y: handle_eof_unit () now alls reset_parser () before
calling logout_or_exit () to prevent incorrect parsing of the
.logout file.
Sat Mar 10 16:40:10 1990 Brian Fox (bfox at gnuwest.fsf.org)
* execute_cmd.c: execute_command_internal (). Fixed bug of
backgrounded shell control structures not being in the background.
* subst.c: expand_word_internal (); If a command substitution
string was not closed properly, the shell could walk off of the
end of a string. Fixed with simple test.
* parse.y: shell_getc (); now takes argument saying how to handle
backslash-newline. All calls to shell_getc () adjusted.
read_token () adjusted to handle new scheme; it has to know when
to allow backslash newline, and when to ignore.
* builtins.c: echo_builtin (); Words ending in `\' handled
incorrectly, allowing a reference past the end of the string.
Fixed.
* execute_cmd.c: find_user_command_in_path ();
if PATH ended with a `:', then that didn't mean to search
`.' for a file. Now it does.
* builtins.c: added hack to history_builtin (). Let
history -s args produce output the way that ARGS would if typed
interactively. Thus "history -s "!?ema" might produce
"ls -l emacs-18.55.tar.Z".
* Added sun-cmd.termcap to the examples directory.
* POSIX`fied jobs.c: new define tcsetpgrp () takes place of
ioctl TIOCSPGRP; order of setting pgrp and terminal pgrp now
pgrp first, then terminal next.
Fri Mar 9 00:04:53 1990 Brian Fox (bfox at gnuwest)
* subst.c: new function unquote_bang () removes backslashed `!'
from single-quoted strings after extracting them.
Sat Feb 24 13:40:12 1990 Brian Fox (bfox at gnuwest.gnu.org)
* parse.y:read_token (); backslash doesn't quote inside
of single quotes. Esp. newline.
Tue Jan 30 09:23:13 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* cpp-Makefile, machines.h, config.h: HAVE_SETLINEBUF define is
defined or not in machines.h.
* shell.c: main (); Line buffer stdout as well as stderr.
builtins.c: type_builtin (), jobs_builtin (), alias_builtin (),
cd_builtin (), dirs_builtin (). fflush (stdout) after printing.
jobs.c: pretty_print_job (); fflush (stream) after printing.
Sat Jan 20 12:02:41 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* unwind_prot.c: run_unwind_protects_internal () -- don't
run a non-existant function, like when the element is a
catch frame marker.
Fri Jan 19 16:57:31 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* variables.c: getenv () now calls find_tempenv_variable () first
to find the most recent exported variable.
* variables.c: find_tempenv_variable () -- new function. Makes a
shell variable if one exists in the temporary environment for a
command and returns that, or NULL otherwise. Used in
set_or_show_attributes (), found in builtins.c. This specifically
allows shell builtins to get the value of variables in the local
environment for this command.
* parse.y: pre_process_line (). Don't do any preprocessing if
history_exapnsion_inhibited is on. builtins.c: parse_and_execute
(). Save and restore the value of history_expansion_inhibited,
not of history_expansion. In this way, .bashrc files can set or
clear this flag with "set +o".
Thu Jan 18 19:52:02 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* builtins.c: All builtins use builtin_error () instead of
report_error (). All builtins have a return value.
get_numeric_value () no longer takes FOR_WHOM argument. The value
is now taken from THIS_COMMAND_NAME. Ditto for no_args ().
* builtins.c: new function builtin_error () is similar to
report_error (), but can never exit the shell, and uses the value
of this_command_name in reports.
Fri Jan 5 11:12:31 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* variables.c: initialize_shell_variables (). Added new variable
HOSTTYPE which contains the machine type that this shell is
compiled on. Also affected Makefile for additional define and
rule for variables.c.
* parse.y: pre_process_line (). In the case of ALIAS not being
defined, a non-malloced string could be returned. Fixed by
calling savestring (line) in that case.
* execute_cmd.c: do_redirections (), do_redirect ():
Added noclobber variable. If set redirections are
not allowed to overwrite existing files. Also affected subst.c:
stupidly_hack_variables.
Thu Jan 4 11:51:25 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* builtins.c: pushd_builtin (), popd_builtin (). If variable
"pushd_silent" exists don't print out new directory after cd'ing.
Allow pushd and popd to take "-NUM" args -- they count back from
the end of the list.
Wed Jan 3 11:42:30 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* Gave variables two cells; one for value, one for functions.
This modifies a large number of files. The function cell of
a variable is addressed with "function_cell (var)"; this can be
a LHS. The value cell is addressed with "value_cell (var)".
There is no more att_function; you can still check to see if the
variable has a function value with function_p (var).
Mon Sep 4 18:30:33 1989 Brian Fox (bfox at aurel)
* copy_command.c: copy_command (). Don't forget to copy
the command redirections.
Sun Sep 3 08:23:04 1989 Brian Fox (bfox at aurel)
* readline.c: update_display (). Fixed printing of initial
character on line twice bug.
Fri Sep 1 18:52:08 1989 Brian Fox (bfox at aurel)
* readline.c: rl_insert (). Optimized for large amounts
of typeahead. Insert all insertable characters at once.
* I update this too irregularly.
Released 1.03.
jobs.c: stop_pipeline (). If THE_PIPELINE is null, don't
try to install it as a job.
execute_command.c: execute_simple_command (). Fixed call
to stop_pipeline () by adding required arguments.
parse.y: yy_error (), new function report_syntax_error ().
CASE case uses report_syntax_error ().
shell.c: main (). If the input to the shell is a command file,
then remember the name of the file in with_input_from_stream ().
Tue Aug 8 18:11:54 1989 Brian Fox (bfox at aurel)
* general.c: strindex () now placed there. Static version
is in readline.c.
* execute_cmd.c: If the shell is to read a file as commands,
and the file appears to contain non-ascii characters, then
complain about it being a binary file.
Sun Aug 6 13:07:41 1989 Brian Fox (bfox at aurel)
* unwind_prot.c: Added tag based unwind frames.
begin_unwind_frame ("foo");
add_unwind_protect (free, data);
add_unwind_protect (free, data);
...
run_unwind_frame ("foo");
* readline.c: Added input buffer management, and event
input.
rl_event_hook, if non-zero, is the address of a function to
call repeatadly while polling for input.
rl_stuff_char (char) pushes CHAR onto input ring.
rl_get_char (&char) (when returning non-zero) pops the front of
the input ring, placing it into CHAR (an int).
rl_gather_tyi () puts characters into input ring if available.
* execute_cmd.c: execute_simple_command (): even when a function
is being piped we need to set return_catch_flag.
Sat Aug 5 08:32:05 1989 Brian Fox (bfox at aurel)
* variables.c: make_var_array (), initialize_shell_variables ()
Added exporting of functions.
* read_builtin (): reads characters singly from stdin, allowing
backslash-newline to pass.
* test.c: use access () instead of opening files.
* numerous files, parse_and_execute (), with_input_from...
Added stream_name to contents of pushed and popped streams,
and to functions that push and pop streams. yyerror () uses
this to aid in reporting errors.
Fri Aug 4 12:35:08 1989 Brian Fox (bfox at aurel)
* copy_cmd.c copy_redirect (): case of r_read_until falls through
to copy the actual here-document.
Wed Aug 2 11:47:50 1989 Brian Fox (bfox at aurel)
* builtins.c:cd_builtin (): if the shell variable "cdable_vars"
exists, and the directory specified cannot be changed to, either
first with CDPATH or directly, the the directory name is looked
up in the list of shell variables. If it exists, and is a
string, then that value is tried.
* test.c: moved `!' operator to term () from expr ()
Tue Aug 1 16:03:32 1989 Brian Fox (bfox at aurel)
* execute_cmd.c, builtins.c: global variable return_catch_value
now contains the value of `return' calls.
* parse.y: current_readline_prompt gets NULL after it is freed.
Sun Jul 16 07:51:46 1989 Brian Fox (bfox at aurel)
* test.c: Added -S to test for file being a socket.
builtins.c: Added documentation for -S test.
* execute_cmd.c: execute_case_command ()
The clause patterns are now expanded before being
matched against.
Tue Jul 11 05:30:58 1989 Brian Fox (bfox at aurel)
* parse.y:yy_readline_get ()
Fixed bug with readline returning EOF.
* All files
Changed #ifndef NOJOBS to #ifdef JOB_CONTROL.
Sat Jul 8 05:02:39 1989 Brian Fox (bfox at aurel)
* parse.y
New command type `Group' is for running commands in `{}'. This
allows all of the commands to be piped at the same time.
Wed Jun 28 16:51:42 1989 Brian Fox (bfox at aurel)
* New directory: LIB contains readline and history stuff,
and is Make-able on its own. Also contains its own
ChangeLog.
* history.c: removed shell dependent stuff, made into module
in readline library.
Tue Jun 27 13:05:54 1989 Brian Fox (bfox at aurel)
* readline.c: removed shell dependent stuff.
* New file: bashline.c contains all of the shell specific
readline material in an attempt to begin using the
readline stuff as a library.
Mon Jun 26 13:35:16 1989 Brian Fox (bfox at aurel)
* parse.y
Fixed problem in read_token () which prevented '{' from
being recognized after "c () {". Changed
reserved_word_acceptable () to know about `{' as precursor
to commands.
* readline.c, jobs.c
Make commands that do not complete sucessfully restore the
tty state to whatever it was before the command was executed.

653
bin/old/bash-1.05/FEATURES Normal file
View File

@@ -0,0 +1,653 @@
-*- text -*-
This isn't real documentation, but we have to tell people how this shell is
different from others.
NEW STUFF SINCE LAST RELEASE:
history_control variable.
Set to a value of "ignorespace", it means don't enter lines which begin
with a SPC on the history list.
Set to a value of "ignoredups", it means don't enter lines which match
the last entered line.
Unset, or any other value than those above mean to save all lines read
by the parser on the history list.
END OF NEW STUFF
When and how bash executes login, rc, and logout files.
Login shells:
On login:
if /etc/profile exists, source it.
if ~/.bash_profile exists, source it,
else if ~/.bash_login exists, source it,
else if ~/.profile exists, source it.
On logout:
if ~/.bash_logout exists, source it.
Non-login interactive shells:
On startup:
if ~/.bashrc exists, source it.
Non-interactive shells:
On startup:
if the environment variable "ENV" is non-null, source the file
mentioned there.
So, typically, your ~/.bash_profile file contains the line
if [ -f ~/.bashrc ]; then source ~/.bashrc; fi
after (or before) any login specific initializations.
You can tell if a shell is interactive or not from within your ~/.bashrc
file by examining $PS1; it is unset in non-interactive shells, and set in
interactive shells. Thus:
if [ "$PS1" = "" ]; then
echo This shell is not interactive
else
echo This shell is interactive
fi
You can ask an interactive bash to not run your .bashrc file, with the
-norc flag. You can change the name of the .bashrc file to any other
file with -rcfile FILENAME. You can ask bash to not run your
.bash_profile file with -noprofile.
alias: alias [ name [=value] ...]
Alias with no arguments prints the list of aliases in the form
name=value on standard output. An alias is defined for each NAME
whose VALUE is given. A trailing space in VALUE causes the next
word to be checked for alias substitution. Alias returns true
unless a NAME is given for which no alias has been defined.
unalias: unalias [name ...]
Remove NAMEs from the list of defined aliases.
exec: exec [ [-] file [redirections]]
Exec FILE, replacing this shell with the specified program.
If FILE is not specified, the redirections take effect in this
shell. If the first argument is `-', then place a dash in the
zeroith arg passed to FILE. This is what login does. If the file
cannot be exec'ed for some reason, the shell exits, unless the
shell variable "no_exit_on_failed_exec" exists.
help: help [pattern]
Display helpful information about builtin commands. If
PATTERN is specified, gives detailed help on all commands
matching PATTERN, otherwise a list of the builtins is
printed.
enable: enable [-n name ...]
Enable and disable builtin shell commands. This allows
you to use a disk command which has the same name as a shell
builtin. If -n is used, the NAMEs become disabled. Otherwise
NAMEs are enabled. For example, to use /bin/test instead of the
shell builtin version, you would type `enable -n test'.
pushd: pushd [dir | +n]
Save the current directory on a list and then CD to DIR.
With no arguments, exchanges the top two directories.
+n Brings the Nth directory to the top of the list by rotating.
dir Makes the current working directory be the top of
the stack, and then cd's to DIR.
You can see the saved directory list with the `dirs' command.
popd: popd [+n]
Pops the directory stack, and cd's to the new top directory.
The elements are numbered from 0 starting at the first directory
listed with `dirs'; i.e. `popd' is equivalent to `popd 0'.
history: history [n] [ [-w -r] [filename]]
Display the history list with line numbers. Lines listed with
with a `*' have been modified. Argument of N says to list only
the last N lines. Argument `-w' means write out the current
history file. `-r' means to read it instead. If FILENAME is
given, then use that file, else if $HISTFILE has a value, use
that, else use ~/.bash_history.
********************
NEW Ulimit Implementation
ulimit: ulimit [-cdmstf [limit]]
Ulimit provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
option is given, it is interpreted as follows:
-c the maximum size of core files created
-d the maximum size of a process's data segment
-m the maximum resident set size
-s the maximum stack size
-t the maximum amount of cpu time in milliseconds
-f the maximum size of files created by
If limit is given, it is multiplied by a constant factor (a block
size, currently 512) and the result becomes the new value of the
specified resource. If limit is not given, the current value of
the specified resource is printed. If no option is given, then the
maximum allowable size of a file created by the shell or any of its
children is printed (equivalent to the -f option).
********************
Tilde expansion:
This shell does tilde expansion:
~ = $HOME
~/foo = $HOME/foo
~fred/foo = (fred's home directory)/foo
~+/foo = $PWD/foo
~-/foo = $OLDPWD/foo
We have functions. You can say:
foo () { ls $1 ; }
or
function foo () { ls $1 ; }
Here is the comment next to the decode_prompt_string function.
/* Return a string which will be printed as a prompt. The string
may contain special characters which are decoded as follows:
\t the time
\d the date
\n CRLF
\s the name of the shell
\w the current working directory
\u your username
\h the hostname
\# the command number of this command
\! the history number of this command
\<octal> character code in octal
\\ a backslash
*/
Here is the comment next to the check_mail function, which is called
periodically. See the documentation for ksh MAILCHECK MAILPATH, etc.
We also have MAIL_WARNING, see below.
/* check_mail () is useful for more than just checking mail. Since it has
the paranoids dream ability of telling you when someone has read your
mail, it can just as easily be used to tell you when someones .profile
file has been read, thus letting one know when someone else has logged
in. Pretty good, huh? */
/* Check for mail in some files. If the modification date of any
of the files in MAILPATH has changed since we last did a
remember_mail_dates () then mention that the user has mail.
Special hack: If the shell variable MAIL_WARNING is on and the
mail file has been accessed since the last time we remembered, then
the message "The mail in <mailfile> has been read" is printed. */
READLINE:
This is the library that handles reading input when using an interactive
shell. The line editing commands are similar to emacs' line editing commands.
You may change the default key-bindings with a ~/.inputrc file. Various
programs that use this library may add their own commands and bindings.
If you wanted to make M-C-u do universal-argument, then in your ~/.inputrc file
you would put:
M-Control-u: universal-argument
or
C-Meta-u: universal-argument
You can use the following names for characters: RUBOUT, DEL, ESC,
NEWLINE, SPACE, RETURN, LFD, TAB
You can start with a vi-like editing mode by placing
set editing-mode vi
in your ~/.inputrc file.
You can have readline use a single line for display, scrolling the input
between the two borders by placing
set horizontal-scroll-mode On
in your ~/.inputrc file.
The following is a list of the names of the commands and the default
key-strokes to get them.
COMMANDS FOR MOVING:
beginning-of-line (C-a)
Move to the start of the current line.
end-of-line (C-e)
Move to the end of the line.
forward-char (C-f)
Move forward a character.
backward-char (C-b)
Move back a character.
forward-word (M-f)
Move forward to the end of the next word.
backward-word (M-b)
Move back to the start of this, or the previous, word.
clear-screen (C-l)
Clear the screen leaving the current line at the top of the screen.
COMMANDS FOR MANIPULATING THE HISTORY:
accept-line (Newline, Return)
Accept the line regardless of where the cursor is. If this line is
non-empty, add it too the history list. If this line was a history
line, then restore the history line to its original state.
previous-history (C-p)
Move `up' through the history list.
next-history (C-n)
Move `down' through the history list.
beginning-of-history (M-<)
Move to the first line in the history.
end-of-history (M->)
Move to the end of the input history, i.e., the line you are entering!
reverse-search-history (C-r)
Search backward starting at the current line and moving `up' through
the history as necessary. This is an incremental search. Maybe I
should have reg-exp searches as well?
forward-search-history (C-s)
Search forward starting at the current line and moving `down' through
the the history as neccessary.
expand-line (M-C-e)
Expand the line the way that the shell will when it reads it. This
does alias and history expansion. See HISTORY EXPANSION below.
COMMANDS FOR CHANGING TEXT:
delete-char (C-d)
Delete the character under the cursor. If the cursor is at the
beginning of the line, and there are no characters in the line, and
the last character typed was not C-d, then return EOF.
backward-delete-char (Rubout)
Delete the character behind the cursor. A numeric arg says to kill
the characters instead of deleting them.
quoted-insert (C-q, C-v)
Add the next character that you type to the line verbatim. This is
how to insert things like C-q for example.
tab-insert (M-TAB)
Insert a tab character.
self-insert (a, b, A, 1, !, ...)
Insert yourself.
transpose-chars (C-t)
Drag the character before point forward over the character at point.
Point moves forward as well. If point is at the end of the line, then
transpose the two characters before point. Negative args don't work.
transpose-words (M-t)
Drag the word behind the cursor past the word in front of the cursor
moving the cursor over that word as well.
upcase-word (M-u)
Uppercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
downcase-word (M-l)
Lowercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
capitalize-word (M-c)
Uppercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
KILLING AND YANKING:
kill-line (C-k)
Kill the text from the current cursor position to the end of the line.
This saves the killed text on the kill-ring. (see below)
backward-kill-line ()
Kill backward to the beginning of the line. This is normally unbound.
kill-word (M-d)
Kill from the cursor to the end of the current word, or if between
words, to the end of the next word.
backward-kill-word (M-Rubout)
Kill the word behind the cursor.
unix-line-discard (C-u)
Do what C-u used to do in Unix line input. We save the killed text on
the kill-ring, though.
unix-word-rubout (C-w)
Do what C-w used to do in Unix line input. The killed text is saved
on the kill-ring. This is different than backward-kill-word because
the word boundaries differ.
yank (C-y)
Yank the top of the kill ring into the buffer at point.
yank-pop (M-y)
Rotate the kill-ring, and yank the new top. You can only do this if
the prior command is yank or yank-pop.
ARGUMENTS:
digit-argument (M-0, M-1, ... M--)
Add this digit to the argument already accumulating, or start a new
argument. M-- starts a negative argument.
universal-argument ()
Do what C-u does in emacs. By default, this is not bound.
COMPLETING:
complete (TAB)
Attempt to do completion on the text before point. In the shell,
filenames and commands are completed on.
possible-completions (M-?)
List the possible completions of the text before point.
MISCELLANEOUS:
abort (C-g)
Ding! Stops things.
do-uppercase-version (M-a, M-b, ...)
Run the command that is bound to your uppercase brother.
prefix-meta (ESC)
Make the next character that you type be Meta-fied. This is for
people without a meta key. ESC-f is equivalent to Meta-f.
undo (C-_)
Incremental undo, separately remembered for each line.
revert-line (M-r)
Undo all changes made to this line. This is like typing the `undo'
command enough times to get back to the beginning.
The shell has several variables which are there just for controlling the
behavior of the interactive shell. Here they are:
HISTFILE: The name of the file that the command history is saved in.
HISTSIZE: If set, this is the maximum number of commands to remember
in the history.
histchars: The two characters which control history expansion and
tokenization. The first character is the history_expansion_char,
that is, the character which signifies the start of a history
expansion, normally '!'. The second character is the character
which signifies the remainder of the line is a comment, when found
as the first character of a word.
hostname_completion_file:
Contains the name of a file in the same format as /etc/hosts
that should be read when the shell needs to complete a
hostname. You can change the file interactively; the next
time you want to complete a hostname Bash will add the
contents of the new file to the already existing database.
MAILCHECK: How often (in seconds) that the shell should check for mail
in the file(s) specified in MAILPATH.
MAILPATH: Colon separated list of pathnames to check for mail in. You can
also specify what message is printed by separating the pathname from
the message with a `?'. $_ stands for the name of the current
mailfile. e.g.
MAILPATH='/usr/spool/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"'
ignoreeof:
IGNOREEOF:
Controls the action of the shell on receipt of an EOF character
as the sole input. If set, then the value of it is the number
of EOF characters that can be seen in a row as sole input characters
before the shell will exit. If the variable exists but does not
have a numeric value (or has no value) then the default is 10.
if the variable does not exist, then EOF signifies the end of
input to the shell. This is only in effect for interactive shells.
auto_resume:
This variable controls how the shell interacts with the user and
job control. If this variable exists then single word simple
commands without redirects are treated as candidates for resumption
of an existing job. There is no ambiguity allowed; if you have
more than one job beginning with the string that you have typed, then
the most recently accessed job will be selected.
no_exit_on_failed_exec:
If this variable exists, the shell will not exit in the case that it
couldn't execute the file specified in the `exec' command.
PROMPT_COMMAND:
If present, this contains a string which is a command to execute
before the printing of each top-level prompt.
nolinks:
If present, says not to follow symbolic links when doing commands
that change the current working directory. By default, bash follows
the logical chain of directories when performing `cd' type commands.
For example, if /usr/sys is a link to /usr/local/sys then:
cd /usr/sys; echo $PWD -> /usr/sys
cd ..; pwd -> /usr
if `nolinks' is present, then:
cd /usr/sys; echo $PWD -> /usr/local/sys
cd ..; pwd -> /usr/local
**********************************************************************
Shell Command Line Options
Along with the single character shell command-line options (documented in
`set') there are several other options that you can use. These options must
appear on the command line before the single character command options to be
recognized.
-norc
Don't load ~/.bashrc init file. (Default if shell name is `sh').
-rcfile FILENAME
Load FILENAME init file (instead ~/.bashrc).
-noprofile
Don't load ~/.bash_profile (or /etc/profile).
-version
Display the version number of this shell.
-login
Make this shell act as if it were directly invoked from login.
This is equivalent to "exec - bash" but can be issued from
another shell, such as csh. If you wanted to replace your
current login shell with a bash login shell, you would say
"exec bash -login".
-nobraceexpansion
Do not preform curly brace expansion (foo{a,b} -> fooa foob).
-nolineeding
Do not use the GNU Readline library to read interactive text
lines.
**********************************************************************
History Expansion:
The following text is taken directly from the history.texinfo file, node
Interactive Use.
Interactive Use
***************
History Expansion
=================
The shell supports a history expansion feature that is similar to
the history expansion in Csh. The following text describes what
syntax features are available.
History expansion takes place in two parts. The first is
determining which line from the previous history to use during
substitution. The second is to select portions of that line for
inclusion into the current one. The line selected from the
previous history is called the "event", and the portions of that
line that are acted upon are called "words". The line is broken
into words in the same fashion that the Bash shell does, so that
several English (or Unix) words surrounded by quotes are considered
as one word.
Event Designators
-----------------
An event designator is a reference to a command line entry in the
history list.
`!'
Start a history subsititution, except when followed by a SPC,
TAB, RET, = or (.
`!!'
Refer to the previous command. This is a synonym for `!-1'.
`!n'
Refer to command line N.
`!-n'
Refer to the current command line minus N.
`!string'
Refer to the most recent command starting with STRING.
`!?string[?]'
Refer to the most recent command containing STRING.
Word Designators
----------------
Words A : separates the event specification from the word
designator. It can be omitted if the word designator begins with a
^, $, * or %. Words are numbered from the beginning of the line,
with the first word being denoted by a 0 (zero).
`#'
The entire command line typed so far. This means the current
command, not the previous command, so it really isn't a word
designator, and doesn't belong in this section.
`0 (zero)'
The zero'th word. For most applications, this is the command
word.
`n'
The N'th word.
`^'
The first argument. that is, word 1.
`$'
The last argument.
`%'
The word matched by the most recent `?string?' search.
`x-y'
A range of words; `-Y' Abbreviates `0-Y'.
`*'
All of the words, excepting the zero'th. This is a synonym
for `1-$'. It is not an error to use * if there is just one
word in the event. The empty string is returned in that case.
Modifiers
---------
After the optional word designator, you can add a sequence of one
or more of the following modifiers, each preceded by a :.
`h'
Remove a trailing pathname component, leaving only the head.
`r'
Remove a trailing suffix of the form ".xxx", leaving the
basename.
`e'
Remove all but the suffix.
`t'
Remove all leading pathname components, leaving the tail.
`p'
Print the new command but do not execute it. This takes
effect immediately, so it should be the last specifier on the
line.
------------------------------------------------------------
More redirections than other sh's. Isn't that great?
command &>file
redirects both stdout and stderr into FILE.
------------------------------------------------------------
Curly Brace Expansion
foo{a,b}-> fooa foob
----------------------------------------
Command Substitution with "$( commands ... )
The shell now supports $(command) command substitution. This is akin to
the older (and still supported) style of command substitution:
`command`.
Here is one way to get your hostname isolated:
using $(): echo $(basename $(hostname) $(domainname))
using ``: echo `basename \`hostname\` \`domainname\``
type: type [-type | -path] [name ...]
For each NAME, indicate how it would be interpreted if used as a
command name.
If the -type flag is used, returns a single word which is one of
`alias', `function', `builtin', `file' or `', if NAME is an
alias, shell function, shell builtin, disk file, or unfound,
respectively.
If the -path flag is used, either returns the name of the disk file
that would be exec'ed, or nothing if -type wouldn't return `file'.

83
bin/old/bash-1.05/INSTALL Normal file
View File

@@ -0,0 +1,83 @@
Hey Emacs, this is yet another file of -*- text -*-.
You should be reading this file if you were directed here by the README
file. If you are installing Bash on a Sun or Vax, or other popular
machine, you probably need to do no more than type `make'. If Bash says
that your machine type is "UNKNOWN_MACHINE", or Bash thought it knew
something about your machine, but was wrong, then reading this file
could be of use to you.
Files in the Make Process
*************************
Makefile: This is responsible for making the actual Makefile that
will be used to create Bash. It runs the C preprocessor
(usually located in /lib/cpp) on the file `cpp-Makefile'
producing the output file `bash-Makefile'.
cpp-Makefile: This is a file of C comments and text. It contains a
reasonable number of `ifdefs' which control what files
get compiled and which flags are passed to the various C
files comprising Bash. It includes a file called
`machines.h'.
machines.h: This file contains the basic compilation parameters for
all of the machines that Bash has been ported to. It
consists of a series of conditional blocks, one per
machine type. The blocks are conditionalized based upon
the unique identifier that `cpp' has predefined for this
machine. In some cases, additional information can be
passed in from `Makefile', such as whether or not a
particular file is available on this system, etc.
bash-Makefile: This is the output from the initial stage of `make'. It
is a stripped down version of cpp-Makefile which is
tailor-made for your machine and OS. All subsequent
makes use this file.
Porting to a New Machine
************************
You need to create a block in machines.h which is conditional based on a
unique identifier present in your version of the C preprocessor. If you
don't know what that symbol is, you might try the following simple test:
echo "main () { }" > foo.c
cc -v foo.c
and look for -DMACHINE, where MACHINE is an identifier for your machine.
If you are very unlucky, your machine's C preprocessor doesn't have a
unique identifier. In this case you will have to define the identifier
in Makefile manually. Let's say you have a machine from Yoyodyne
Industries, called the YoYo. It runs a version of BSD, so it is
reasonably compatible. However, the cpp on this YoYo machine doesn't
define any unique identifiers. You change the Makefile line for
CPPFLAGS to:
CPPFLAGS = -P -DYoYo
Then, in machines.h, you copy the block for UNKNOWN_MACHINE, and change
the conditional to
#if defined (YoYo)
Inside of the YoYo block you define M_MACHINE="YoYo", and M_OS=BSD. You
also modify the existing defines to match your machine's software.
If Bash still won't compile, perhaps because of missing code that is
required for your YoYo machine, you will have to write that code, and
place it within a conditional block based on YoYo.
Most Un*x machines will simply require a few of the default values to be
redefined. I would appreciate having all fixes and changes mailed back
to me in the form of context diffs:
diff -c orig-machines.h machines.h >machines.diffs
Please don't hesitate to include which version of the shell that you
have.
Brian Fox
bfox@ai.mit.edu (Personal e-mail)
bash-maintainers@ai.mit.edu (Context diffs for Bash bug fixes)
bug-bash.ai.mit.edu (Discussion and questions about Bash)

View File

@@ -0,0 +1,39 @@
# Hey Emacs, this Makefile is in -*- text -*- mode!
#
# Makefile for Bash.
# If your cpp doesn't like -P, just get rid of it.
# If you wish to use Gcc, then just type "make CC=gcc".
# If you wish to use GNU's Make, then change the MAKE define.
# If you don't like the destination, then change DESTDIR. (This only
# matters if you are typing `make install'.)
# The file that you most likely want to look at is cpp-Makefile.
#
# If you haven't read README, now might be a good time.
DESTDIR = /usr/gnu/bin
MAKE = make
#CPP_DEFINES = -DHAVE_GCC -DHAVE_FIXED_INCLUDES -DHAVE_BISON
CPP = /lib/cpp $(CPPFLAGS)
#CPP = $(CC) -E
CPPFLAGS = -P $(SYSTEM) $(CPP_DEFINES) -DM_DESTDIR=$(DESTDIR)
CPP_ARGS = -DCPP_CC=$(CC) `./makeargs.sh`
all: bash-Makefile
$(MAKE) -f bash-Makefile
bash-Makefile: cpp-Makefile Makefile machines.h makeargs.sh
cp cpp-Makefile tmp-Makefile.c
@echo $(CPP) $(CPP_ARGS) tmp-Makefile.c \| cat -s >bash-Makefile
@$(CPP) $(CPP_ARGS) tmp-Makefile.c | cat -s >bash-Makefile
rm -f tmp-Makefile.c
# Subsequent lines contain targets that are correctly handled by an
# existing bash-Makefile.
install newversion mailable distribution backup : bash-Makefile
$(MAKE) -f bash-Makefile $@
bash.tar.Z carryall documentation tags clone clean dist-clean: bash-Makefile
$(MAKE) -f bash-Makefile $@

63
bin/old/bash-1.05/README Normal file
View File

@@ -0,0 +1,63 @@
Hey Emacs, this is a -*- text -*- file.
This is the README file for bash, the Bourne Again SHell. This shell
comes with no documentation at this time. There is an online help
facility, and a file called FEATURES that comes with the distribution.
When the documentation is completely finished, it will be included in
the distribution. No partial documentation is included because it
causes complaints.
INSTALLING:
The file "Makefile" no longer needs to be edited. In fact, to install
Bash, the simplest thing to do is to type "make". The Bash Makefiles
will try to dynamically figure out what kind of machine and operating
system you are using, and will make an educated guess. During the make
process a message is displayed describing what machine and OS has been
chosen (this information is also saved in the file ".machine"). If the
displayed information is incorrect, you will have to edit the file
"machines.h". The instructions for doing so are present in that file.
The file called INSTALL gives detailed instructions on installation.
However, for most machines, simply following this simple checklist
is quite adequate:
1) Type `make'.
2) Wait for the compilation to finish.
3) Type `./bash' to see if the compile worked.
4) Type `cp ./bash /usr/gnu/bin/bash' (or wherever you
keep GNU binaries).
BUT WHAT IF IT DOESN'T INSTALL SO EASILY?
Read INSTALL.
REPORTING BUGS:
If you find a bug in bash, you should report it. But first, you should
make sure that it really is a bug, and that it appears in the latest
version of Bash that you have.
Once you have ascertained that a bug really exists, you are welcome to
mail me a bug report. If you have a fix, you are welcome to mail that
to me as well! Suggestions and `philosophical' bug reports may be mailed
to bug-bash@ai.mit.edu. Real bug reports may be mailed to the same
place, or to me, bfox@ai.mit.edu.
ALL bug reports should include:
* The version number of Bash
* The hardware and operating system
* The compiler used to compile
* A description of the bug behaviour
* A short script or `recipe' which exercises the bug
Without this information, I generally cannot successfully debug Bash,
because usually, without this information, I generally cannot make the
bug manifest itself!
Enjoy,
Brian Fox

279
bin/old/bash-1.05/alias.c Normal file
View File

@@ -0,0 +1,279 @@
/* alias.c -- Not a full alias, but just the kind that we use in the
shell. Csh style alias is somewhere else. */
/* Copyright (C) 1987,1989 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include "general.h"
#include "alias.h"
/* The number of slots to allocate when we need new slots. */
#define alias_list_grow_amount 50
/* Non-zero means expand all words on the line. Otherwise, expand
after first expansion if the expansion ends in a space. */
int alias_expand_all = 0;
/* The list of aliases that we have. */
ASSOC **aliases = (ASSOC **)NULL;
/* The number of slots in the above list. */
static int aliases_size = 0;
/* The number of aliases that are in existence. */
static int aliases_length = 0;
/* The last alias index found with find_alias (). */
static int last_alias_index = 0;
/* Scan the list of aliases looking for one with NAME. Return NULL
if the alias doesn't exist, else a pointer to the assoc. */
ASSOC *
find_alias (name)
char *name;
{
register int i;
for (i = 0; i < aliases_length; i++)
if (strcmp (name, aliases[i]->name) == 0)
return (aliases[last_alias_index = i]);
return ((ASSOC *)NULL);
}
/* Return the value of the alias for NAME, or NULL if there is none. */
char *
get_alias_value (name)
char *name;
{
ASSOC *alias = find_alias (name);
if (alias)
return (alias->value);
else
return ((char *)NULL);
}
/* Make a new alias from NAME and VALUE. If NAME can be found,
then replace its value. */
void
add_alias (name, value)
char *name, *value;
{
ASSOC *temp = find_alias (name);
if (temp)
{
free (temp->value);
temp->value = savestring (value);
}
else
{
temp = (ASSOC *)xmalloc (sizeof (ASSOC));
temp->name = savestring (name);
temp->value = savestring (value);
if ((aliases_length + 1) >= aliases_size)
{
if (!aliases)
aliases =
(ASSOC **)xmalloc ((aliases_size = alias_list_grow_amount)
* sizeof (ASSOC *));
else
aliases =
(ASSOC **)xrealloc (aliases,
(aliases_size += alias_list_grow_amount)
* sizeof (ASSOC *));
}
aliases[aliases_length++] = temp;
aliases[aliases_length] = (ASSOC *)NULL;
}
}
/* Remove the alias with name NAME from the alias list. Returns
the index of the removed alias, or -1 if the alias didn't exist. */
int
remove_alias (name)
char *name;
{
register int i;
if (!find_alias (name))
return (-1);
i = last_alias_index;
free (aliases[i]->name);
free (aliases[i]->value);
free (aliases[i]);
for (; i < aliases_length; i++)
aliases[i] = aliases[i + 1];
aliases_length--;
aliases[aliases_length] = (ASSOC *)NULL;
return (last_alias_index);
}
/* Delete all aliases. */
delete_all_aliases ()
{
register int i;
for (i = 0; i < aliases_length; i++)
{
free (aliases[i]->name);
free (aliases[i]->value);
free (aliases[i]);
aliases[i] = (ASSOC *)NULL;
}
aliases_length = 0;
}
/* Return non-zero if CHARACTER is a member of the class of characters
that are self-delimiting in the shell. */
self_delimiting (character)
int character;
{
return (member (character, " \t\n\r;|&("));
}
/* Return a new line, with any aliases substituted. */
char *
alias_expand (string)
char *string;
{
int line_len = 1 + strlen (string);
char *line = (char *)xmalloc (line_len);
register int i, j, start, delimiter;
char *token = (char *)alloca (line_len);
int tl, real_start, in_command_position;
int expand_next = 1;
ASSOC *alias;
line[0] = i = 0;
/* Find the next word in line. If it has an alias, substitute
the alias value. If the value ends in ` ', then try again
with the next word. Else, if there is no value, or if
the value does not end in space, we are done. */
next_word:
token[0] = 0;
/* Skip leading whitespace (or separator characters).
But save it in the output. */
for (start = i; string[i]; i++)
{
if (whitespace (string[i]))
continue;
if (self_delimiting (string[i]))
{
expand_next++;
continue;
}
break;
}
if (start == i && string[i] == '\0')
return (line);
j = strlen (line);
if (1 + j + (i - start) >= line_len)
line = (char *)xrealloc (line, line_len += (50 + (i - start)));
strncpy (line + j, string + start, i - start);
line[j + (i - start)] = '\0';
real_start = i;
in_command_position = (self_delimiting (string[i]) || expand_next);
expand_next = 0;
/* From here to next separator character is a token. */
delimiter = 0;
for (start = i; string[i]; i++)
{
switch (string[i])
{
case '\\':
if (string[i + 1])
{
i++;
continue;
}
break;
case '"':
case '\'':
if (!delimiter)
delimiter = string[i];
else if (delimiter == string[i])
delimiter = 0;
break;
}
if (!delimiter &&
(whitespace (string[i]) || self_delimiting (string[i])))
break;
}
tl = strlen (token);
strncpy (token + tl, string + start, i - start);
token [tl += (i - start)] = '\0';
/* See if this word has a substitution. If it does, do the expansion,
but only if we are expanding all words, or if we are in a location
where an expansion is supposed to take place. */
alias = find_alias (token);
if (alias && (in_command_position || alias_expand_all))
{
char *v = alias->value;
int l = strlen (v);
/* +3 because we possibly add one more character below. */
if ((l + 3) > line_len - strlen (line))
line = (char *)xrealloc (line, line_len += (50 + l));
strcat (line, v);
if ((l && whitespace (v[l - 1])) || alias_expand_all)
{
if (l && whitespace (v[l -1]))
line[strlen (line) - 1] = '\0';
expand_next = 1;
}
}
else
{
int ll = strlen (line), tl = i - real_start;
/* int tl = strlen (token); */
if (ll + tl + 2 > line_len)
line = (char *)xrealloc (line, line_len += 50 + ll + tl);
strncpy (line + ll, string + real_start, tl);
line[ll + tl] = '\0';
/* strcat (line, token); */
}
goto next_word;
}

Some files were not shown because too many files have changed in this diff Show More