Fastest shells in the west (with the help of "screen")
Dan Jacobson
jacobson at gamma.eecs.nwu.edu
Sat Apr 15 21:34:13 AEST 1989
A person wanted to know how one jumps into yesterday's shell instead of
waiting to build a fresh shell:
My .tcshrc file is in disrepair (off maintenance), as the thrill of
being a computer nurd is wearing thin ... but essentially what I do
there (I think ... hope) is:
if (! $?HAVELOGGEDIN) setenv PATH .... #for rsh, your favorite path
if (! $?prompt) exit # not interactive shell
#"exit" exits only this script in (t)csh language
if (! $?HAVELOGGEDIN) then
biff y
screen -r && exit #if successful then leave minimal login shell
#underneath
endif
[then I go on to build the usual environment, e.g. key bindings]
[can set shell variables here]
[...]
if ($?HAVELOGGEDIN) exit
setenv HAVELOGGEDIN
[can set environment variables here]
screen
(no .login file)
I should add that the csh language is not my favorite and I wait for a
final release of bash (Bourne Again shell).
Where to get "screen":
Screen was posted to comp.sources.unix a while back, otherwise please
contact its author (below). Here's part of the man page. You need
BSD style sockets I believe to run it.
SCREEN(1) UNIX Programmer's Manual SCREEN(1)
NAME
screen - screen manager with VT100/ANSI terminal emulation
SYNOPSIS
screen [ -a ] [ -f ] [ -n ] [ -exy ] [ cmdargs]
screen -r [ host.tty]
DESCRIPTION
screen is a full-screen window manager that multiplexes a
physical terminal between several processes (typically
interactive shells). Each virtual terminal provides the
functions of the DEC VT100 terminal and, in addition,
several control functions from the ANSI X3.64 (ISO 6429) and
ISO 2022 standards (e.g. insert/delete line and support for
multiple character sets).
When screen is called, it creates a single window with a
shell; the pathname of the shell is taken from the environ-
ment symbol $SHELL; if this is not defined, "/bin/sh" is
used. New windows can be created at any time by calling
screen from within a previously created window. The program
to be started in a newly created window and optional argu-
ments to the program can be supplied when screen is invoked.
For instance,
screen csh
will create a window with a C-Shell and switch to that win-
dow. When the process associated with the currently
displayed window terminates (e.g. ^D has been typed to a
shell), screen switches to the previously displayed window;
when no more windows are left, screen exits.
When "/etc/utmp" is writable by screen, an appropriate
record is written to this file for each window and removed
when the window is terminated.
The -r option is used to resume a screen session that has
been detached from the terminal by means of the "detach"
command key (see below). This mechanism allows a user to
disconnect screen together with all currently active windows
from the terminal and resume it at a later point in time,
e.g. at a later login session, and possibly on a different
terminal. The type of terminal on which a detached screen
is resumed must of course be compatible to the type of ter-
minal on which screen has originally been invoked. When
more than one detached screen exist, the -r option displays
a list of host.tty pairs identifying the detached screens.
In this case an additional host.tty argument can be given to
resume a specific screen session.
[gobs deleted]
C-a d or C-a C-d
Detach screen (disconnect it from the terminal and put
it into the background). A detached screen can be
resumed by invoking screen with the -r option.
[gobs deleted]
AUTHOR
Oliver Laumann (net at tub.bitnet)
--
Dan Jacobson, jacobson at eecs.nwu.edu, {oddjob,gargoyle,att,...}!nucsrl!jacobson
More information about the Comp.unix.wizards
mailing list