Menu software... Here it is: "lush" version 1.34, part 1/2
Paul Shields
shields at yunccn.UUCP
Mon Jan 8 20:49:59 AEST 1990
This is the little menu shell program I bragged about in comp.unix.xenix
last thursday. I hope you all didn't get false expectations about it.
I took the time to generate a few example menu files and double-check to
make sure it still compiles on the Sun over at ISTS.
Doubtless there are still problems with it. But I'm always open to
constructive criticism. So give it a try.
Enjoy!
Paul Shields.
#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive. Save this into a file, edit it
# and delete all lines above this comment. Then give this
# file to sh by executing the command "sh file". The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rw-r--r-- 1 bin staff 2051 Jan 8 03:03 HISTORY
# -rw-r--r-- 1 bin staff 3678 Jan 8 01:46 INSTALL
# -rw-r--r-- 2 bin staff 1706 Jan 8 02:10 Makefile
# -rw-r--r-- 1 bin staff 1653 Jan 8 02:12 Makefile.BSD
# -rw-r--r-- 1 bin staff 1659 Jan 8 02:14 Makefile.Sun
# -rw-r--r-- 2 bin staff 1706 Jan 8 02:10 Makefile.Xenix
# -rw-r--r-- 1 bin staff 940 Jan 8 01:23 PROBLEMS
# -rw-r--r-- 1 bin staff 983 Jan 7 19:35 README
# -rw-r--r-- 1 bin staff 3330 Jan 8 03:08 WARRANTY
# -rw-r--r-- 1 bin staff 711 Jan 7 19:50 login.sample
# -rw-r--r-- 1 bin staff 726 Jan 8 02:57 lush.doc
# -rw-r--r-- 1 bin staff 300 Jan 8 02:44 lushrc.sample
# -rw-r--r-- 1 bin staff 148 Jan 8 01:11 lushrc.test
# -rw-r--r-- 1 bin staff 12973 Jan 8 02:42 menu.sample
# -rw-r--r-- 1 bin staff 1325 Jan 7 19:56 menu.test
#
echo 'x - HISTORY'
if test -f HISTORY; then echo 'shar: not overwriting HISTORY'; else
sed 's/^X//' << '________This_Is_The_END________' > HISTORY
Xlush Revision History
X---------------------
X
X1987:
X May ??. v0.00 (PAS) MS-DOS version.
X Sep 6. v0.10 (PAS) Port to Xenix SysV.
X Load config file from $LUSHRC;
X security feature: strip user input: "<|>";
X Case is now insensitive.
X Nov ??. v0.20 (PAS) Alpha test phase begins.
X
X1988:
X Mar 11. v1.00 (PAS) Alpha version debugged and tested on
X SysV Xenix and MS-DOS. Beta phase begins.
X Mar ??. v1.10 (PAS) Added simple termcap support.
X Apr 15. v1.11 (PAS) debugged termcap support.
X Apr 11. v1.20 (PAS) extended support to SunOs 3.5,
X (BSD4.2 variant, non-ANSI C compiler.)
X Apr 16, v1.21 (PAS) merged v1.11+1.20.
X May 11. v1.22 (PAS) corrected a problem in the Makefiles.
X May 29. v1.23 (PAS) security fix: ignore SIGTSTP.
X Jun 13. v1.30 (PAS) several valuable enhancements:
X added "invisible" commands.
X added switches on the command line:
X lush -f rcfile -R rootmenu
X Handle ~user
X Enable setenv (function #12.)
X
X1989:
X Mar 1. v1.31 (PAS) added a primitive to quit to main menu.
X
X1990:
X Jan 5. v1.32 (PAS) security feature: strip ";&" from user input.
X Jan 5. v1.32 (PAS) Generated documentation for the public release.
X Jan 7. v1.33 (PAS) Lots.
X Added switches -M, -U, -G. -f is now a synonym for -M.
X Created the config.h file.
X Added global and local environment configuration files. This is
X to enable lush to run as the top level shell. These files are
X of the format VAR=string, and are placed into the environment
X before the menu file is loaded.
X Redefined the meaning of the LUSHRC environment variable. Now,
X it points to the user environment config file, whereas before it
X pointed to the menu file itself. This radical change is
X justified to avoid confusion when the first public release is
X put out.
X Broke mparse.c down into mfile.c, mlex.c, and mparse.c. This is
X to facilitate letting other parts of the code use the lexical
X analyser.
X Added more documentation and sample files.
X Jan 8. v1.34 (PAS) Froze the files for public release.
________This_Is_The_END________
if test `wc -l < HISTORY` -ne 51; then
echo 'shar: HISTORY was damaged during transit (should have been 51 lines)'
fi
fi ; : end of overwriting check
echo 'x - INSTALL'
if test -f INSTALL; then echo 'shar: not overwriting INSTALL'; else
sed 's/^X//' << '________This_Is_The_END________' > INSTALL
XThis file gives instructions on how to set up lush. It assumes you have
Xsystem manager privileges.
X
X. Choose the correct Makefile based on your system and compiler. The
X SysV and Xenix configutations should be the same. You may want to
X change BINDIR and LIBDIR in the Makefile.
X
X. Type make to build the program.
X
X. Test that it is working, with the following command:
X
X ./lush -M menu.test -G lushrc.test
X
X This should place a test menu on the screen. Try each option.
X
X. Create and configure the files lushrc (the system config file) and
X menu (the system menu file.) There are samples (lushrc.sample,
X menu.sample) of each of these. This is typically very site-specific.
X Documentation for the syntax of the menu file is included in
X menu.sample. The syntax of the lushrc file is apparent from the sample.
X
X. Type make install to place the binary in BINDIR and the config
X files in LIBDIR.
X
X. Create a test account to use the menu system. You can make this use
X lush as the login shell or run it from another shell.
X
X The single remaining problem with using lush as the login shell is
X that there is no good way to set the terminal type. This may be done
X from sh or csh in the usual way. Lush needs to have the environment variable
X TERM in order to work properly. If term is not set at all, lush will
X try "dumb" as a last resort.
X
X BEWARE: If you run lush from another shell...
X (1) You must trap interrupt and quit signals in the .profile of the
X other shell. Lush handles these, but if you do not trap them,
X there is a time window in which the user could break through to
X the bare shell.
X (2) Be sure to add a logout statement after lush exits, since lush
X won't automatically log out the user if run as a sub-shell.
X
XNotes:
X
X1.If you invoke lush from a another shell, you may place switches
X on the command line:
X
X lush [-M menu-file] [-R root-menu] [-G global-config-file]
X [-U user-config-file]
X
X The optional switch '-G' tells lush the location of the global run-time
X configuration file (see lushrc.sample). The default value, set in
X config.h, is usually /usr/lib/lush/lushrc. This file contains a list
X of environment definitions that will be set up before any other file
X is loaded. These environment variables are used as defaults to the
X other parameters below, and are available to the designer of the menu
X file (see menu.sample) during execution.
X
X The optional switch '-U' tells lush the location of the user run-time
X configuration file. The default is the $LUSHRC environment variable.
X If not defined, the value set in config.h (usually ~/.lushrc) is used.
X It is similar to the global rc file, above, but serves to permit
X configuration on a per-user basis.
X
X The optional switch '-M' tells lush where to find the menu
X specification file. The default is the $MENUFILE environment
X variable. If not defined, the value set in config.h (usually
X /usr/lib/lush/menu) is used as a last resort.
X
X The switch '-R' tells lush which menu is the root, (the first
X menu to be displayed.) The default is the $ROOTMENU environment
X variable. If not defined, the value set in config.h (usually
X MAIN_MENU) is used as a last resort.
X
X2.When lush runs, it ensures that the following environment variables
X are initialized:
X
X Variable Default Purpose
X -------- ------- -------
X SHELL argv[0] the name of the shell
X USER in /etc/passwd your username (security feature)
X TTY ttyname() your terminal name (security feature)
X TERM "dumb" your terminal type (specific terminal handling)
X HOME in /etc/passwd your home directory
________This_Is_The_END________
if test `wc -l < INSTALL` -ne 83; then
echo 'shar: INSTALL was damaged during transit (should have been 83 lines)'
fi
fi ; : end of overwriting check
echo 'x - Makefile'
if test -f Makefile; then echo 'shar: not overwriting Makefile'; else
sed 's/^X//' << '________This_Is_The_END________' > Makefile
X# Makefile.Xenix
X# Xenix System V Generic Makefile for lush
X
XLIBDIR=/usr/lib/lush
XBINDIR=/usr/local/bin
X
X# compiler definitions you might want to have:
X#
X# -DPROTOTYPE if your compiler can handle prototype statements
X# -DMSDOS if you are running under MS-DOS
X# -DSUN if you are running on a Sun workstation
X
XCC = cc -M0s -i -Zi
XDEBUG =
XDEFS = -DPROTOTYPE
XCFLAGS = $(DEBUG) $(DEFS)
XLDFLAGS= -Fmlush.map
XLIBS = -lc -ltermcap
X
XHFILES = mparse.h mlex.h mfile.h menu.h edit.h lush.h defs.h version.h config.h
XCFILES = mparse.c mlex.c mfile.c menu.c edit.c lush.c envinit.c getin.c login.c
XOBJS = mparse.o mlex.o mfile.o menu.o edit.o lush.o envinit.o getin.o login.o
X
X# ----------------------------- dependencies --------------------------------
X
Xlush: $(OBJS)
X $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o lush
X
Xclean:
X -rm -f lush a.out core errs *.o *.map
X
Xinstall: lush lushrc menu
X -test -d $(BINDIR) || mkdir $(BINDIR)
X -test -d $(LIBDIR) || mkdir $(LIBDIR)
X -strip lush
X chmod 755 lush
X chmod 644 lushrc menu
X cp lush $(BINDIR)
X cp lushrc menu $(LIBDIR)
X
Xmparse.o: mparse.c mparse.h mlex.h mfile.h menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) mparse.c -c
X
Xmlex.o: mlex.c mlex.h mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mlex.c -c
X
Xmfile.o: mfile.c mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mfile.c -c
X
Xmenu.o: menu.c menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) menu.c -c
X
Xedit.o: edit.c edit.h lush.h defs.h config.h
X $(CC) $(CFLAGS) edit.c -c
X
Xenvinit.o: envinit.c lush.h defs.h config.h
X $(CC) $(CFLAGS) envinit.c -c
X
Xlogin.o: login.c defs.h
X $(CC) $(CFLAGS) login.c -c
X
Xgetin.o: getin.c defs.h
X $(CC) $(CFLAGS) getin.c -c
X
Xlush.o: lush.c lush.h defs.h config.h version.h
X $(CC) $(CFLAGS) lush.c -c
________This_Is_The_END________
if test `wc -l < Makefile` -ne 66; then
echo 'shar: Makefile was damaged during transit (should have been 66 lines)'
fi
fi ; : end of overwriting check
echo 'x - Makefile.BSD'
if test -f Makefile.BSD; then echo 'shar: not overwriting Makefile.BSD'; else
sed 's/^X//' << '________This_Is_The_END________' > Makefile.BSD
X# Makefile.BSD
X# Generic BSD4.2 Makefile for lush
X
XLIBDIR=/usr/lib/lush
XBINDIR=/usr/local/bin
X
X# compiler definitions you might want to have:
X#
X# -DPROTOTYPE if your compiler can handle prototype statements
X# -DMSDOS if you are running under MS-DOS
X# -DSUN if you are running on a Sun workstation
X
XDEBUG =
XDEFS = -DBSD
XCFLAGS = $(DEBUG) $(DEFS)
XLDFLAGS=
XLIBS = -ltermcap
X
XHFILES = mparse.h mlex.h mfile.h menu.h edit.h lush.h defs.h version.h config.h
XCFILES = mparse.c mlex.c mfile.c menu.c edit.c lush.c envinit.c getin.c login.c
XOBJS = mparse.o mlex.o mfile.o menu.o edit.o lush.o envinit.o getin.o login.o
X
X# ----------------------------- dependencies --------------------------------
X
Xlush: $(OBJS)
X $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o lush
X
Xclean:
X -rm -f lush a.out core errs *.o *.map
X
Xinstall: lush lushrc menu
X -test -d $(BINDIR) || mkdir $(BINDIR)
X -test -d $(LIBDIR) || mkdir $(LIBDIR)
X -strip lush
X chmod 755 lush
X chmod 644 lushrc menu
X cp lush $(BINDIR)
X cp lushrc menu $(LIBDIR)
X
Xmparse.o: mparse.c mparse.h mlex.h mfile.h menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) mparse.c -c
X
Xmlex.o: mlex.c mlex.h mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mlex.c -c
X
Xmfile.o: mfile.c mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mfile.c -c
X
Xmenu.o: menu.c menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) menu.c -c
X
Xedit.o: edit.c edit.h lush.h defs.h config.h
X $(CC) $(CFLAGS) edit.c -c
X
Xenvinit.o: envinit.c lush.h defs.h config.h
X $(CC) $(CFLAGS) envinit.c -c
X
Xlogin.o: login.c defs.h
X $(CC) $(CFLAGS) login.c -c
X
Xgetin.o: getin.c defs.h
X $(CC) $(CFLAGS) getin.c -c
X
Xlush.o: lush.c lush.h defs.h config.h version.h
X $(CC) $(CFLAGS) lush.c -c
________This_Is_The_END________
if test `wc -l < Makefile.BSD` -ne 65; then
echo 'shar: Makefile.BSD was damaged during transit (should have been 65 lines)'
fi
fi ; : end of overwriting check
echo 'x - Makefile.Sun'
if test -f Makefile.Sun; then echo 'shar: not overwriting Makefile.Sun'; else
sed 's/^X//' << '________This_Is_The_END________' > Makefile.Sun
X# Makefile.Sun
X# SunOs BSD 4.2 Makefile for lush
X
XLIBDIR=/usr/lib/lush
XBINDIR=/usr/local/bin
X
X# compiler definitions you might want to have:
X#
X# -DPROTOTYPE if your compiler can handle prototype statements
X# -DMSDOS if you are running under MS-DOS
X# -DSUN if you are running on a Sun workstation
X
XDEBUG =
XDEFS = -DBSD -DSUN
XCFLAGS = $(DEBUG) $(DEFS)
XLDFLAGS=
XLIBS = -ltermcap
X
XHFILES = mparse.h mlex.h mfile.h menu.h edit.h lush.h defs.h version.h config.h
XCFILES = mparse.c mlex.c mfile.c menu.c edit.c lush.c envinit.c getin.c login.c
XOBJS = mparse.o mlex.o mfile.o menu.o edit.o lush.o envinit.o getin.o login.o
X
X# ----------------------------- dependencies --------------------------------
X
Xlush: $(OBJS)
X $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o lush
X
Xclean:
X -rm -f lush a.out core errs *.o *.map
X
Xinstall: lush lushrc menu
X -test -d $(BINDIR) || mkdir $(BINDIR)
X -test -d $(LIBDIR) || mkdir $(LIBDIR)
X -strip lush
X chmod 755 lush
X chmod 644 lushrc menu
X cp lush $(BINDIR)
X cp lushrc menu $(LIBDIR)
X
Xmparse.o: mparse.c mparse.h mlex.h mfile.h menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) mparse.c -c
X
Xmlex.o: mlex.c mlex.h mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mlex.c -c
X
Xmfile.o: mfile.c mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mfile.c -c
X
Xmenu.o: menu.c menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) menu.c -c
X
Xedit.o: edit.c edit.h lush.h defs.h config.h
X $(CC) $(CFLAGS) edit.c -c
X
Xenvinit.o: envinit.c lush.h defs.h config.h
X $(CC) $(CFLAGS) envinit.c -c
X
Xlogin.o: login.c defs.h
X $(CC) $(CFLAGS) login.c -c
X
Xgetin.o: getin.c defs.h
X $(CC) $(CFLAGS) getin.c -c
X
Xlush.o: lush.c lush.h defs.h config.h version.h
X $(CC) $(CFLAGS) lush.c -c
________This_Is_The_END________
if test `wc -l < Makefile.Sun` -ne 65; then
echo 'shar: Makefile.Sun was damaged during transit (should have been 65 lines)'
fi
fi ; : end of overwriting check
echo 'x - Makefile.Xenix'
if test -f Makefile.Xenix; then echo 'shar: not overwriting Makefile.Xenix'; else
sed 's/^X//' << '________This_Is_The_END________' > Makefile.Xenix
X# Makefile.Xenix
X# Xenix System V Generic Makefile for lush
X
XLIBDIR=/usr/lib/lush
XBINDIR=/usr/local/bin
X
X# compiler definitions you might want to have:
X#
X# -DPROTOTYPE if your compiler can handle prototype statements
X# -DMSDOS if you are running under MS-DOS
X# -DSUN if you are running on a Sun workstation
X
XCC = cc -M0s -i -Zi
XDEBUG =
XDEFS = -DPROTOTYPE
XCFLAGS = $(DEBUG) $(DEFS)
XLDFLAGS= -Fmlush.map
XLIBS = -lc -ltermcap
X
XHFILES = mparse.h mlex.h mfile.h menu.h edit.h lush.h defs.h version.h config.h
XCFILES = mparse.c mlex.c mfile.c menu.c edit.c lush.c envinit.c getin.c login.c
XOBJS = mparse.o mlex.o mfile.o menu.o edit.o lush.o envinit.o getin.o login.o
X
X# ----------------------------- dependencies --------------------------------
X
Xlush: $(OBJS)
X $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o lush
X
Xclean:
X -rm -f lush a.out core errs *.o *.map
X
Xinstall: lush lushrc menu
X -test -d $(BINDIR) || mkdir $(BINDIR)
X -test -d $(LIBDIR) || mkdir $(LIBDIR)
X -strip lush
X chmod 755 lush
X chmod 644 lushrc menu
X cp lush $(BINDIR)
X cp lushrc menu $(LIBDIR)
X
Xmparse.o: mparse.c mparse.h mlex.h mfile.h menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) mparse.c -c
X
Xmlex.o: mlex.c mlex.h mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mlex.c -c
X
Xmfile.o: mfile.c mfile.h lush.h defs.h
X $(CC) $(CFLAGS) mfile.c -c
X
Xmenu.o: menu.c menu.h lush.h defs.h config.h
X $(CC) $(CFLAGS) menu.c -c
X
Xedit.o: edit.c edit.h lush.h defs.h config.h
X $(CC) $(CFLAGS) edit.c -c
X
Xenvinit.o: envinit.c lush.h defs.h config.h
X $(CC) $(CFLAGS) envinit.c -c
X
Xlogin.o: login.c defs.h
X $(CC) $(CFLAGS) login.c -c
X
Xgetin.o: getin.c defs.h
X $(CC) $(CFLAGS) getin.c -c
X
Xlush.o: lush.c lush.h defs.h config.h version.h
X $(CC) $(CFLAGS) lush.c -c
________This_Is_The_END________
if test `wc -l < Makefile.Xenix` -ne 66; then
echo 'shar: Makefile.Xenix was damaged during transit (should have been 66 lines)'
fi
fi ; : end of overwriting check
echo 'x - PROBLEMS'
if test -f PROBLEMS; then echo 'shar: not overwriting PROBLEMS'; else
sed 's/^X//' << '________This_Is_The_END________' > PROBLEMS
XThis file is for documenting bugs and misfeatures. Your comments and
Xsuggestions for how to improve lush are always welcome.
X
X1. Lush will run as the login shell, but BEWARE:
X The single remaining problem with using lush as the login shell
X is that there is no good way to set the terminal type.
X This is not good for dialup users, who may be calling from any
X type of terminal.
X
X I'm working on it.
X
X2. Lush uses termcap. I haven't even thought about terminfo.
X
X3. Though it uses termcap, it is still command based. That is, You
Xcan't use the cursor keys to make a selection. I'm currently thinking
Xabout what this would entail, and I want to maintain portability to
XMS-DOS.
X
X4. The MS-DOS part of the code has not been exercised in a while.
X
X5. Ctrl-D is currently ignored. Perhaps it should pop back one menu?
X
X6. Function numbers 4 (CHK_RDACC), 7 (CHK_WRACC), and 11 (CHK_ACCESS)
Xare defined but not currently used.
________This_Is_The_END________
if test `wc -l < PROBLEMS` -ne 24; then
echo 'shar: PROBLEMS was damaged during transit (should have been 24 lines)'
fi
fi ; : end of overwriting check
echo 'x - README'
if test -f README; then echo 'shar: not overwriting README'; else
sed 's/^X//' << '________This_Is_The_END________' > README
XPlease read the file "WARRANTY" in this directory.
X
XLush is a user interface intended to ease the learning curve required to
Xmake effective use of UNIX. System administrators may install it to run
Xas the top-level shell in /etc/passwd, or it may run another shell. It
Xprovides a simple menu for the user, and switches amongst sub-menus or
Xcalls programs based on the menu configuration file.
X
XIt has a partially visual interface, which supports various terminals
Xthrough termcap.
X
XAt this time, it has been tested on BSD 4.2, Xenix System V, and MS-DOS.
XTo compile it under MS-DOS, you will need a library of functions which
Xemulate many of the UNIX system calls (available from me for Lattice C
Xv3.20.) The DOS code has not been exercised in over a year, so it may
Xrequire some work.
X
XTo install it, follow the instructions in the file INSTALL, in this
Xdirectory.
X
XCurrently lush is at version 1.32.
X
XGood luck, and enjoy.
XPaul Shields,
XFri Jan 5 16:31:09 EST 1990
XToronto.
________This_Is_The_END________
if test `wc -l < README` -ne 26; then
echo 'shar: README was damaged during transit (should have been 26 lines)'
fi
fi ; : end of overwriting check
echo 'x - WARRANTY'
if test -f WARRANTY; then echo 'shar: not overwriting WARRANTY'; else
sed 's/^X//' << '________This_Is_The_END________' > WARRANTY
XCopyright(C)1987,1988,1989,1990 by Paul A. Shields. Permission is
Xgranted to redistribute this software as long as the complete source
Xcode is included in the distribution, the files are not altered in any
Xway, and no monetary profit is gained from its distribution.
X
XThis software is provided "as is", without any warranty. The author has
Xmade every effort to test this software, however since it is provided
Xwithout charge, he shall not be held responsible for damages resulting
Xfrom its use nor from the inability to use it. You must assume all
Xcosts of servicing it or replacing it if it does not perform as
Xspecified, or does not meet your expectations.
X
XThe following is a list of the files you should expect to have:
X
Xtotal 198
X-rw-r--r-- 1 bin staff 2051 Jan 8 03:03 HISTORY
X-rw-r--r-- 1 bin staff 3678 Jan 8 01:46 INSTALL
X-rw-r--r-- 2 bin staff 1706 Jan 8 02:10 Makefile
X-rw-r--r-- 1 bin staff 1653 Jan 8 02:12 Makefile.BSD
X-rw-r--r-- 1 bin staff 1659 Jan 8 02:14 Makefile.Sun
X-rw-r--r-- 2 bin staff 1706 Jan 8 02:10 Makefile.Xenix
X-rw-r--r-- 1 bin staff 940 Jan 8 01:23 PROBLEMS
X-rw-r--r-- 1 bin staff 983 Jan 7 19:35 README
X-rw-r--r-- 1 bin staff 3330 Jan 8 03:07 WARRANTY
X-rw-r--r-- 1 bin staff 1054 Jan 8 01:57 config.h
X-rw-r--r-- 1 bin staff 1498 Jan 7 15:51 defs.h
X-rw-r--r-- 1 bin staff 6473 Jan 5 18:16 edit.c
X-rw-r--r-- 1 bin staff 1508 Mar 1 1989 edit.h
X-rw-r--r-- 1 bin staff 8594 Jan 7 18:25 envinit.c
X-rw-r--r-- 1 bin staff 809 Mar 11 1988 getin.c
X-rw-r--r-- 1 bin staff 529 Mar 11 1988 login.c
X-rw-r--r-- 1 bin staff 711 Jan 7 19:50 login.sample
X-rw-r--r-- 1 bin staff 1586 Jan 7 22:26 lush.c
X-rw-r--r-- 1 bin staff 726 Jan 8 02:57 lush.doc
X-rw-r--r-- 1 bin staff 2156 Jan 7 17:56 lush.h
X-rw-r--r-- 1 bin staff 300 Jan 8 02:44 lushrc.sample
X-rw-r--r-- 1 bin staff 148 Jan 8 01:11 lushrc.test
X-rw-r--r-- 1 bin staff 5054 Jan 7 14:35 menu.c
X-rw-r--r-- 1 bin staff 1580 Jan 8 02:01 menu.h
X-rw-r--r-- 1 bin staff 12973 Jan 8 02:42 menu.sample
X-rw-r--r-- 1 bin staff 1325 Jan 7 19:56 menu.test
X-rw-r--r-- 1 bin staff 2403 Jan 8 01:01 mfile.c
X-rw-r--r-- 1 bin staff 1056 Jan 8 00:46 mfile.h
X-rw-r--r-- 1 bin staff 2111 Jan 8 00:54 mlex.c
X-rw-r--r-- 1 bin staff 1082 Jan 8 01:52 mlex.h
X-rw-r--r-- 1 bin staff 9997 Jan 8 01:04 mparse.c
X-rw-r--r-- 1 bin staff 661 Jan 7 23:14 mparse.h
X-rw-r--r-- 1 bin staff 66 Jan 8 03:04 version.h
X
XIf you modify the software in any way for your own use, please send me a
Xcontext-diff with a note explaining the modifications, and I will
Xconsider it for inclusion in the public release.
X
XIf you have any questions about this software, you may reach me at these
Xaddresses:
X
XE-Mail: shields at nccn.yorku.ca, (...uunet!yunccn!shields)
X shields at ists.ists.ca, (...uunet!ists!shields)
X
XPost: Paul Shields,
X Rm 217A Lumbers, York University,
X 4700 Keele Street,
X North York, Ontario,
X M3J 1P3
X Canada
________This_Is_The_END________
if test `wc -l < WARRANTY` -ne 65; then
echo 'shar: WARRANTY was damaged during transit (should have been 65 lines)'
fi
fi ; : end of overwriting check
echo 'x - login.sample'
if test -f login.sample; then echo 'shar: not overwriting login.sample'; else
sed 's/^X//' << '________This_Is_The_END________' > login.sample
X#!/bin/csh - sample .login file for csh, executes the "lush" menu system.
X#
X# assumes lush is in /usr/local/bin
X#
Xonintr - # ignore interrupts
Xset dftype = dumb # initial default terminal type
Xif ( -r ~/.ttype ) set dftype = `cat ~/.ttype`
Xif ( $TERM != 'ansi' ) echo "Enter your terminal type or Press return for the default, \
X(eg: vt100,ansi,wy30,adm3a,dumb.)"
X
X# Use tset -S instead of tset -s in case disk space is exhausted.
Xset noglob
Xset term = (`tset -S -h -m ansi:ansi -m vt100:\?vt100 -m dialup:\?$dftype -m :\?unknown -I`)
Xsetenv TERM $term[1]
Xsetenv TERMCAP $term[2]
Xunset term
Xunset noglob
X
Xif ( $TERM == 'vt100' ) stty erase '^?' # delete deletes
Xunset dftype
X
X/usr/local/bin/lush
Xlogout
________This_Is_The_END________
if test `wc -l < login.sample` -ne 23; then
echo 'shar: login.sample was damaged during transit (should have been 23 lines)'
fi
fi ; : end of overwriting check
echo 'x - lush.doc'
if test -f lush.doc; then echo 'shar: not overwriting lush.doc'; else
sed 's/^X//' << '________This_Is_The_END________' > lush.doc
XSoon to come... in lush 2.0:
X
X% cat /usr/lib/lush/lushrc
X#!lush - sample global lushrc file
X#
X# ... program invocation using ``
XTERM=`/bin/sh /usr/lib/lush/setterm`
X#
X# ... environment variable options with (a,b,c).
XEDITOR=(/bin/red,/usr/bin/emacs)
XNEWSREADER=(/usr/lib/news/vnews,/usr/lib/news/readnews)
XPAGER=(/usr/bin/more,/usr/local/bin/less)
XINTERFACE=(command,pointer)
X
X% cat ~test/.lushrc
X#!lush...
X# for security,
X# user may choose only from list given in global config file.
X# if the user fails to choose, or does so incorrectly, the default
X# will be the first of the options. Need to provide a way for
X# the user to edit it w/o worrying.
XEDITOR=/usr/bin/emacs
XNEWSREADER=/usr/bin/nn
XPAGER=/usr/local/bin/less
________This_Is_The_END________
if test `wc -l < lush.doc` -ne 24; then
echo 'shar: lush.doc was damaged during transit (should have been 24 lines)'
fi
fi ; : end of overwriting check
echo 'x - lushrc.sample'
if test -f lushrc.sample; then echo 'shar: not overwriting lushrc.sample'; else
sed 's/^X//' << '________This_Is_The_END________' > lushrc.sample
XSHELL=/usr/local/bin/lush
XPATH=:/bin:/usr/bin:/usr/local/bin
XMENUFILE=/usr/lib/lush/menu
XROOTMENU=MAIN_MENU
XLUSHRC=~/.lushrc
XMAILER=/usr/bin/mail
XEDITOR=/usr/local/bin/emacs
XNEWSREADER=/usr/lib/news/vnews
XNEWSBOX=~/
XPAGER=/usr/local/bin/less
XLESS=-e -m -q MPMF< -->p< (q=Quit,f=Forward,u=Up,h=Help)>
________This_Is_The_END________
if test `wc -l < lushrc.sample` -ne 11; then
echo 'shar: lushrc.sample was damaged during transit (should have been 11 lines)'
fi
fi ; : end of overwriting check
echo 'x - lushrc.test'
if test -f lushrc.test; then echo 'shar: not overwriting lushrc.test'; else
sed 's/^X//' << '________This_Is_The_END________' > lushrc.test
XROOTMENU=MAIN_MENU
XLUSHRC=/dev/null
XEDITOR=/usr/local/bin/emacs
XPAGER=/usr/local/bin/less
XLESS=-e -m -q MPMF< -->p< (q=Quit,f=Forward,u=Up,h=Help)>
________This_Is_The_END________
if test `wc -l < lushrc.test` -ne 5; then
echo 'shar: lushrc.test was damaged during transit (should have been 5 lines)'
fi
fi ; : end of overwriting check
echo 'x - menu.sample'
if test -f menu.sample; then echo 'shar: not overwriting menu.sample'; else
sed 's/^X//' << '________This_Is_The_END________' > menu.sample
X#!lush
X# file: menu.sample, lush v1.3 sample menu configuration script.
X#
X# Copyright(C)1987,1988,1989,1990 by Paul A. Shields. Permission is
X# granted to redistribute this software as long as the complete source
X# code is included in the distribution, the files are not altered in any
X# way, and no monetary profit is gained from its distribution.
X#
X# This software is provided "as is", without any warranty. The author has
X# made every effort to test this software, however since it is provided
X# without charge, he shall not be held responsible for damages resulting
X# from its use nor from the inability to use it. You must assume all
X# costs of servicing it or replacing it if it does not perform as
X# specified, or does not meet your expectations.
X#
X# Syntax:
X# This file is free format, ie: space, tab, newline, and comments are
X# treated as white space (comments lie between '#' and newline.)
X#
X# EBNF syntax for menu specification:
X# menu_tree :== main_menu { ';' menu } '.'.
X# main_menu :== 'MAIN_MENU' ':' menu_description menu_body.
X# menu :== menu_title ':' menu_decsription menu_body.
X# menu_title :== text.
X# menu_description :== string.
X# menu_body :== cmd_option {',' cmd_option}.
X# cmd_option :== ['-'] cmd_name menu_title '(' [action_list] ')' cmd_description.
X# cmd_description :== string.
X# cmd_name :== text.
X# action_list :== action {';' action}.
X# action :== function_number parameter.
X# parameter :== string.
X# string :== delimiter text delimiter.
X#
X# Notes:
X# 0) Lush reads the entire rc file before beginning, to check syntax.
X# If a syntax error is discovered, it turfs its cookies and
X# identifies the offending line number.
X#
X# 1) Lush traps SIGINT and SIGQUIT signals. SIGINT will abort a
X# command or action-list in progress and return the user to the
X# most recently accessed menu. SIGQUIT is ignored.
X#
X# 2) The standard menu title MAIN_MENU denotes the root. There are three
X# other standard menu titles, NONE, RETURN and QUIT, which control
X# movement through the structure. NONE indicates that there is no
X# child menu, RETURN exits the menu, returning to the parent, and
X# QUIT returns to the main menu.
X#
X# 3) Each menu title has a menu-description, which is a prompt for
X# the user.
X#
X# 4) There will usually be several options for each menu. For
X# every option there is an associated menu title, indicating the
X# name of the menu to activate on successful completion of the
X# action-list.
X#
X# User-typed commands are case insensitive. Further, the user need only
X# enter the shortest unique string among the current menu options
X# to identify the command, eg: q means Quit.
X#
X# Support for hidden options (ie: not displayed in menu) has been added.
X# The appearance of a "-" before the option makes it hidden.
X#
X# 5) Currently the following function-numbers are defined:
X# 0 = CHG_DIRECTORY - change to the named directory.
X# 1 = CHK_PORT - Examines the environment string TTY and tries
X# to find it in the specified file. If found,
X# the operation is permitted. Otherwise it fails.
X# 2 = CHK_TERM - Examines the environment string TERM and tries
X# to find it in the specified file. If found,
X# the operation is permitted. Otherwise it fails.
X# 3 = PAUSE - pause with "Press enter: " message.
X# 4 = - not used.
X# 5 = CALL_CMD - perform a shell command.
X# 6 = SECUR_CHECK - calls getgrnam() to check permission on named group.
X# 7 = - not used.
X# 8 = EXP_TOGGLE - Toggle expert mode. (no menus.)
X# 9 = PNAME - prompt and get parameter name.
X# 10 = P2NAME - prompt and get 2nd parameter name.
X# 11 = - not used.
X# 12 = SET_ENVT - set an environment variable
X# 13 = SAVE_STR - save string in (global) recall-buffer
X# 14 = RECALL_STR1 - put recall-buffer in parameter 1
X# 15 = RECALL_STR2 - put recall-buffer in parameter 2
X#
X# 6) The menu structure is not necessarily a tree. It is a general
X# directed graph. But there is no cycle detection in the
X# initialization, so be careful!
X#
X# 7) Important! Every menu needs at least one option that will RETURN or
X# QUIT.
X#
XMAIN_MENU: "Main Menu"
X Tools TOOLS_MENU (6 "!alien") "Editing and printing tools",
X Mail MAIL_MENU () "Send and Read mail",
X News NEWS_MENU () "Post and Read news articles",
X Phone NONE (5 "who";
X 9 "The above people are logged in. Username to call? ";
X 5 "phone %s") "Call and talk to another user",
X Help HELP_MENU () "Help on how to use the system",
X Transfer XFER_MENU (6 "!alien") "Transferring files on the network",
X Disk DISK_MENU (6 "!alien";
X 1 "/etc/ldevices") "Use the floppy disk",
X Setup SETUP_MENU () "Change Terminal type and other things.",
X-System MAINT_MENU (6 "!alien") "System maintenance",
X-Bye QUIT (5 "echo Goodbye $USER, thanks for using the NCCN.")
X "Sign off and hang up",
X Logout QUIT (5 "echo Goodbye $USER, thanks for using the NCCN.")
X "Sign off and hang up";
X
XTOOLS_MENU: "Tools Menu"
X Dir NONE (9 "Which directory (default is the current one)? ";
X 5 "ls -las %s | $PAGER")
X "Long listing of files in a directory",
X Display NONE (5 "ls -axF";
X 9 "What file names (separated by spaces)? ";
X 5 "$PAGER %s")
X "Display a file ",
X Edit NONE (5 "ls -axF";
X 9 "File name? ";
X 5 "$EDITOR %s") "Edit a file",
X Print NONE (5 "ls -axF";
X 9 "What file names (separated by spaces)? ";
X 5 "lpr %s") "Print a file ",
X Delete NONE (5 "ls -axF";
X 9 "What file names (separated by spaces)? ";
X 5 "echo 'Answer y or n to each file.'; rm -i %s")
X "Delete a file ",
X Copy NONE (5 "ls -axF";
X 9 "from (file name)? ";
X 10 "to (file name)? ";
X 5 "cp %s %s") "Make a copy of a file",
X Rename NONE (5 "ls -axF";
X 9 "Old file name? ";
X 10 "New file name? ";
X 5 "mv %s %s") "Rename a file",
X Mkdir NONE (9 "New directory name? ";
X 5 "mkdir %s") "Make a new directory (file folder)",
X Cwd NONE (9 "Enter directory name? ";
X 0 "%s") "Change your working directory",
X Help NONE (5 "manual tools") "How to use the tools",
X Return RETURN () "Return to previous menu",
X Quit QUIT () "Go back to main menu";
X
XMAIL_MENU: "Mail Menu"
X Send NONE (9 "To: ";
X 5 "$MAILER %s") "Send a message",
X Read NONE (5 "$MAILER") "Read your messages",
X
X Who NONE (5 "/usr/local/bin/ulist | sort -u | $PAGER")
X "List local users",
X Mbox NONE (5 "$MAILER -f $HOME/mbox")
X "Read old messages from your mbox",
X Help NONE (5 "manual mail") "How to use Mail",
X Quit QUIT () "Go back to main menu";
X
XNEWS_MENU: "News Articles"
X Groups NONE (5 "$PAGER /usr/lib/news/newsgroups")
X "List available news groups",
X-List NONE (5 "$PAGER /usr/lib/news/newsgroups")
X "List available news groups",
X Read NONE (6 "!alien";
X 6 "!user";
X 5 "$NEWSREADER -n general nccn to";
X 3 "") "Read NCCN news articles",
X UNitex NONE (5 "$NEWSREADER -n unitex";
X 3 "") "Read United Nations news articles",
X Usenet NONE (9 "which newsgroup(s)? ";
X 5 "$NEWSREADER -n %s";
X 3 "") "Read Usenet news articles",
X Post NONE (6 "!alien";
X 5 "postnews";
X 3 "") "Post a news article",
X NBox NONE (5 "$MAILER -f $NEWSBOX/Articles")
X "Read old messages in your Articles file",
X Help NONE (5 "manual news") "How to use News",
X Quit QUIT () "Go back to main menu";
X
XHELP_MENU: "Help Menu"
X NewUser NONE (5 "manual newuser") "How can I get an account?",
X Emacs NONE (5 "echo 'Type ^X^C to exit' ; emacs /usr/local/man/emacs-tut.doc")
X "Use Emacs on a tutorial file",
X Topic NONE (5 "manual";
X 9 "What Topic? ";
X 5 "manual %s") "Get help on a specific topic",
X Operator NONE (5 "$MAILER root") "Send a mail message to the operator",
X Guidelines NONE (5 "manual guidelines") "Guidelines for Using News",
X Quit QUIT () "Go back to main menu";
X
XMAINT_MENU: "System Maintenance"
X Monitor NONE (6 "!alien";
X 6 "!group";
X 5 "monitor") "Monitor network performance",
X Mkuser NONE (6 "root";
X 5 "/etc/mkuser") "Make a new user account",
X Rmuser NONE (6 "root";
X 9 "Username? ";
X 5 "remuser") "Remove a user's account",
X Shell NONE (6 "!alien";
X 5 "echo Type exit to return to the menus ; csh -i")
X "Spawns an interactive shell",
X Tools TOOLS_MENU () "Editing and printing tools",
X Help NONE (5 "manual maint") "Help on how to maintain the system",
X Quit QUIT () "Go back to main menu";
X
XXFER_MENU: "Transfer Menu"
X Sendfile NONE (9 "Name of file(s) to send? ";
X 10 "User to send to (in the format site!user)? ";
X 5 "send -m -p %s %s")
X "Send a file to another user",
X Receive NONE (5 "receive") "Receive a file from another user",
X Status NONE (5 "uustat -v -u$USER | $PAGER")
X "Check the status of your UUCP requests",
X CallOut NONE (1 "/etc/ldevices";
X 5 "call.out") "Call out to another system with kermit",
X Kermit NONE (5 "kermit") "Start Kermit upload/download protocol",
X Server NONE (1 "/etc/rdevices";
X 5 "kermit -x") "Start Kermit in server mode *CAREFUL*",
X Download NONE (5 "ls -axF";
X 9 "What file names (separated by spaces)? ";
X 5 "cat %s";
X 3 "") "Display a text file without paging or protocol",
X Tools TOOLS_MENU () "Editing and printing tools",
X Help NONE (5 "manual transfer") "How to perform file transfers",
X Quit QUIT () "Go back to main menu";
X
XDISK_MENU: "Floppy Disk Menu"
X Dtype NONE (9 "Which disk (such as 0 or 1)? ";
X 5 "dtype /dev/fd%s") "Determine what type of floppy disk you have",
X Xenix TAR_MENU () "Use floppies in Xenix 'tar' format",
X Dos DOS_MENU () "Use floppies in MS-DOS format",
X Tools TOOLS_MENU () "Editing and printing tools",
X Help NONE (5 "manual floppy") "How to use the floppy disk",
X Quit QUIT () "Go back to main menu";
X
XTAR_MENU: "Xenix Menu"
X Dir NONE (9 "Which disk (such as 0 or 1)? ";
X 10 "File or Directory names (optional)? ";
X 5 "tar tv%s %s | $PAGER")
X "Directory list of a 'tar' Disk",
X From NONE (9 "Which disk (such as 0 or 1)? ";
X 10 "File or Directory names (optional)? ";
X 5 "tar xv%s %s")
X "Copy a file FROM a 'tar' Disk",
X To NONE (9 "Which disk (such as 0 or 1)? ";
X 10 "File or Directory names? ";
X 5 "tar cv%s %s")
X "Copy a file TO a 'tar' Disk",
X Format NONE (9 "Which disk (such as 0 or 1)? ";
X 5 "format /dev/rfd%s48")
X "Format a 360k 'tar' Disk",
X HFormat NONE (9 "Which disk (such as 0 or 1)? ";
X 5 "format /dev/rfd%s96")
X "Format a 1.2M 'tar' Disk (High Density)",
X Help NONE (5 "manual xenix") "How to transfer to/from Xenix disks",
X Return RETURN () "Go to previous menu",
X Quit QUIT () "Go back to Main Menu";
X
X
XDOS_MENU: "MS-DOS Menu"
X Dir NONE (9 "Which disk (such as A: B: X: or Y:)? ";
X 5 "dosdir %s | $PAGER")
X "Directory list of a Disk",
X From NONE (9 "Which disk and file names (no wildcards, eg: a:file)? ";
X 5 "doscp %s .")
X "Copy a file FROM a Disk",
X To NONE (9 "File or Directory names? ";
X 10 "Which disk (such as A: or B:)? ";
X 5 "doscp %s %s")
X "Copy a file TO a Disk",
X BFrom NONE (9 "Which disk and file names (no wildcards)? ";
X 5 "doscp -r %s .")
X "Copy a Binary file FROM a Disk",
X BTo NONE (9 "File or Directory names? ";
X 10 "Which disk (such as A: or B:)? ";
X 5 "doscp -r %s %s")
X "Copy a Binary file TO a Disk",
X Format NONE (9 "Which disk (such as A: or B:)? ";
X 5 "dosformat %s")
X "Format a 360k 'DOS' Disk",
X HFormat NONE (9 "Which disk (such as X: or Y:)? ";
X 5 "dosformat %s")
X "Format a 1.2M 'DOS' Disk (High Density)",
X Help NONE (5 "manual ms-dos") "How to transfer to/from MS-DOS disks",
X Return RETURN () "Go to previous menu",
X Quit QUIT () "Go back to Main Menu";
X
XSETUP_MENU: "Setup Menu"
X ListTerm NONE (5 "echo this command is not set up yet";
X 3 "") "List supported terminal types",
X TermType NONE (5 "echo this command is not set up yet";
X 3 "") "Change your terminal type",
X Erase NONE (5 "echo this command is not set up yet";
X 3 "") "Change the 'erase' character",
X Interrupt NONE (5 "echo this command is not set up yet";
X 3 "") "Change the 'interrupt' character",
X Eof NONE (5 "echo this command is not set up yet";
X 3 "") "Change the 'eof' character",
X Password NONE (5 "passwd") "Change your password",
X Help NONE (5 "echo this command is not set up yet";
X 3 "") "Get help on the Setup Menu",
X Quit QUIT () "Go back to Main Menu".
________This_Is_The_END________
if test `wc -l < menu.sample` -ne 303; then
echo 'shar: menu.sample was damaged during transit (should have been 303 lines)'
fi
fi ; : end of overwriting check
echo 'x - menu.test'
if test -f menu.test; then echo 'shar: not overwriting menu.test'; else
sed 's/^X//' << '________This_Is_The_END________' > menu.test
X#!lush
X# file: menu.test, lush v1.3 menu configuration script. See the file
X# menu.sample for explanation of the syntax.
X
XMAIN_MENU: "Main Menu"
X One MENU_ONE () "Demonstrate infinite regress",
X Two MENU_TWO () "Same as above, with different starting point",
X Shell NONE (5 "echo Type exit to return to the menus ; csh -i")
X "Spawns an interactive shell",
X Test TEST_MENU () "Check out some environment variables.",
X Bye QUIT (5 "echo Goodbye.") "Sign off and hang up";
X
XMENU_ONE: "Sub-Menu One"
X SubMenu MENU_TWO () "Go to sub-menu Two",
X Return RETURN (5 "echo loop, endless: see endless loop";
X 3 "") "Go back 1 level.",
X Quit QUIT () "Go back to main menu.";
X
XMENU_TWO: "Sub-Menu Two"
X SubMenu MENU_ONE () "Go to sub-menu One",
X Return RETURN (5 "echo endless loop: see loop, endless";
X 3 "") "Go back 1 level.",
X Quit QUIT () "Go back to main menu.";
X
XTEST_MENU: "Test.Menu"
X Lushrc NONE (5 "echo $LUSHRC"; 3 "") "Print LUSHRC name.",
X Path NONE (5 "echo $PATH"; 3 "") "Print PATH.",
X User NONE (5 "echo $USER"; 3 "") "Print USER name.",
X Home NONE (5 "echo $HOME"; 3 "") "Print HOME name.",
X Tty NONE (5 "echo $TTY"; 3 "") "Print TTY name.",
X Term NONE (5 "echo $TERM"; 3 "") "Print TERM name.",
X Pager NONE (5 "echo $PAGER"; 3 "") "Print PAGER name.",
X Quit QUIT () "Go back to main menu.".
________This_Is_The_END________
if test `wc -l < menu.test` -ne 33; then
echo 'shar: menu.test was damaged during transit (should have been 33 lines)'
fi
fi ; : end of overwriting check
exit 0
--
Paul Shields, shields at nccn.yorku.ca (..!uunet!yunccn!shields)
More information about the Alt.sources
mailing list