Thread View: comp.unix.unixware
1 messages
1 total messages
Started by eric
Mon, 15 Aug 1994 21:10
Windowing Korn Shell Script
Author: eric
Date: Mon, 15 Aug 1994 21:10
Date: Mon, 15 Aug 1994 21:10
886 lines
24807 bytes
24807 bytes
Hi;
The following is a simple application written using wksh. I wrote
it some time back but haven't gotton around to posting it until now.
For those of you interested is using wksh (with the Motif toolkit), this
should provide you with some useful sample code.
Enjoy
Eric W.
#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 08/15/1994 20:45 UTC by eric@theking
# Source directory /home/eric/News/hold
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 13873 -rwxr-xr-x Finger
# 433 -rw-r--r-- Quakes
# 1872 -rw-r--r-- README
# 868 -rw-r--r-- Weather
# 992 -rwxr-xr-x install
# 1684 -rw-r--r-- main
#
# ============= Finger ==============
if test -f 'Finger' -a X"$1" != X"-c"; then
echo 'x - skipping Finger (File already exists)'
else
echo 'x - extracting Finger (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'Finger' &&
#!/usr/X/bin/wksh -motif
X
# Use DEBUG="set -x" for debugging
DEBUG=
$DEBUG
X
# Finger version 1.1
#
# Copyright 1994 Novell Inc.
#
# Permission to use, copy, modify, and distribute this software
# for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Novell not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission. Novell make
# no representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.
#
# Novell DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL Novell BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
X
# Finger information from selected servers. Based upon a csh
# script written by Scott Yanoff (yanoff@csd4csd.uwm.edu)
# Future enhancements will include the ability to add selections to
# the current menus using text fields and better attachments of
# widgets (what do I know about widgets, practice makes better).
#
# All menu files are flat text files which take the form of:
# Site Description login@to.be.fingered
# Menu Description FileName
#
# Additionaly, using the word "separator" within the menu
# file will cause a separator gadget to be placed in that
# location on the scrolling window. This is usefull for
# seprating menus from locations (Thanks JTruher).
#
# If you look edit the file main and search for "Earthquake
# Info Menu" you will see the word quakes as the last entry,
# this indicates that there is an additional file to use for
# a menu. Menus can point to menus. Remember that since this
# is shell some characters will cause failures when reading
# menus. If you get an error while reading a menu file, check
# to see if there are any special characters or reserved words
# used by the shell.
#
# If there is an environment variable called FILEPATH defined,
# then Finger will assume that this is where the menu files
# reside. If there is en environment variable called LPCMD
# then Finger will assume this to be your print command.
# Both FILEPATH and LPCMD can be changed by editing Finger
# or .profile (assuming sh or ksh is the login shell).
#
# Enjoy
#
# Eric Wallengren
# (Eric_Wallengren@Novell.COM)
X
# Determine which release of UnixWare is running
UWVersion=`uname -r`
X
# Define finger output file
FingerFile=/tmp/.fingerinfo.$$
X
# Define message file output (for printing etc)
MessageFile=/tmp/.message.$$
X
# Setup filepath for menus
if [[ -z "$FILEPATH" ]]
then
X FILEPATH=/usr/X/lib/Finger
fi
X
# Define lp command this should be set up as part of
# the users' environment
if [[ -z "$LPCMD" ]]
then
X LPCMD="lp"
fi
X
# Function for removing fingerinfo and MessageFile files
RemoveFile()
{
X $DEBUG
X if [[ -r $FingerFile ]]
X then
X rm $FingerFile
X fi
X if [[ -r $MessageFile ]]
X then
X rm $MessageFile
X fi
}
X
# Function for exiting
Quit_CB()
{
X $DEBUG
X RemoveFile
X exit 0
}
X
# Callback for printing
Print_CB()
{
X # Since the file contains what is in the
X # text widget, printit
X if [[ -r "$FingerFile" ]]
X then
X $LPCMD $FingerFile >$MessageFile 2>/dev/null
X # Show that the print job has left
X if [[ $? != 0 ]]
X then
X warn "Cannot contact lp service, check your configuration"
X else
X warn "`cat $MessageFile`"
X fi
X else
X warn "No information to print"
X fi
}
X
# Function used when selecting Close
Close_CB()
{
X $DEBUG
X RemoveFile
X pd ${1}
}
X
# Finction for displaying finger info
ShowItem()
{
X $DEBUG
X # See if popup already exists
X if [[ -z "$FPOPUP" ]]
X then
X # Create popup
X cps FPOPUP Finger topLevelShell $TOPLEVEL
X sv $FPOPUP allowShellResize:true
X
X # Create a form for info
X cmw FFORM fform form $FPOPUP \
X textFontList:fixed \
X noResize:false \
X resizePolicy:RESIZE_ANY \
X rubberPositioning:true
X
X # Create the scrolled window
X cmw FWINDOW window scrolledWindow $FFORM \
X scrollingPolicy:AUTOMATIC \
X visualPolicy:VARIABLE \
X topAttachment:ATTACH_WIDGET \
X leftAttachment:ATTACH_WIDGET \
X rightAttachment:ATTACH_WIDGET \
X topWidget:$FFORM \
X leftWidget:$FORM \
X rightWidget:$FORM
X
X # Create text widget
X cmw FTEXT text text $FWINDOW \
X rows:25 \
X columns:80 \
X wordWrap:true \
X resizeHeight:true \
X editable:false \
X resizeWidth:true
X
X # Create separator
X crtseparatorg FSEP $FFORM fsep
X sv $FSEP topAttachment:ATTACH_WIDGET
X sv $FSEP topWidget:$FTEXT
X sv $FSEP leftAttachment:ATTACH_WIDGET
X sv $FSEP leftWidget:$FFORM
X sv $FSEP rightAttachment:ATTACH_WIDGET
X sv $FSEP rightWidget:$FFORM
X sv $FSEP height:5
X
X # Create OK button
X crtpushbg OK $FFORM CLOSE activateCallback:"Close_CB $FPOPUP"
X gv $OK height:okh
X crtpushbg PRINT $FFORM PRINT activateCallback:"Print_CB $FPOPUP"
X
X sv $OK topAttachment:ATTACH_WIDGET
X sv $OK topWidget:$FSEP
X sv $OK leftAttachment:ATTACH_WIDGET
X sv $OK leftWidget:$FFORM
X sv $OK rightAttachment:ATTACH_POSITION
X sv $OK rightPosition:50
X sv $OK bottomAttachment:ATTACH_WIDGET
X sv $OK bottomWidget:$FFORM
X sv $PRINT topAttachment:ATTACH_WIDGET
X sv $PRINT topWidget:$FSEP
X sv $PRINT leftAttachment:ATTACH_POSITION
X sv $PRINT leftPosition:50
X sv $PRINT rightAttachment:ATTACH_WIDGET
X sv $PRINT rightWidget:$FFORM
X sv $PRINT bottomAttachment:ATTACH_WIDGET
X sv $PRINT bottomWidget:$FFORM
X fi
X
X # Reset values for before popping up window
X SetValues "${1}"
X
X # Popup the window
X pu $FPOPUP
}
X
# Function for resetting values associated with window sizes
SetValues()
{
X $DEBUG
X # Put the name of the widget here
X sv $FPOPUP title:"${1}"
X sv $FPOPUP iconName:"${1}"
X
X # Populate text widget
X sv $FTEXT value:"`cat $FingerFile`"
X
X # Get height and width of the text widget
X gv $FTEXT height:h
X gv $FTEXT width:w
X
X # Create boundries in case there is alot of info
X if (($h>380))
X then
X h=380
X fi
X
X # Height is less than 100, set at 100 anyway
X if (($h<100)) && (($h>0))
X then
X h=100
X fi
X
X # Set the height and width of the window
X ((w=$w+32))
X
X # Don't want incredibly wide windows!
X if (($w>530))
X then
X w=530
X fi
X
X # If the height is too high, a negative number is
X # returned from gv $FTEXT height, so make the window
X # a reasonable height!
X if (($h<0))
X then
X h=380
X fi
X
X # Set the height an width here
X sv $FWINDOW height:$h
X sv $FWINDOW width:$w
}
X
# Function for running finger
Selected_CB()
{
X $DEBUG
X # See if an "@" exists in arg 1
X echo ${1} |grep "\@" >/dev/null 2>&1
X
X # If the "@" exists then finger the host
X if [[ $? -eq 0 ]]
X then
X # Finger the location selected
X finger ${1} |tr -d "\015" >$FingerFile 2>/dev/null
X # Count the number of lines printed
X Lines=`wc -l $FingerFile |awk '{print $1}'`
X # Not enough info to be worth it
X if (($Lines<5))
X then
X warn "No information found ${1}"
X else
X ShowItem "${1}"
X fi
X else
X # Item selected is an additional file
X PopupItems ${1}
X fi
X # Set the value set to false for selected widget
X Reset=${2}
X sv W${Reset} set:false
}
X
# Function for popping up a new selection list
PopupItems()
{
X $DEBUG
X
X # Set this value to zippo
X Same=0
X
X # Make sure that a file exists for menu
X if [[ ! -f $FILEPATH/${1} ]]
X then
X if [[ -r $FingerFile ]]
X then
X rm $FingerFile
X fi
X fatal "FATAL ERROR: No file ${1}"
X fi
X
X # Set the value of array to zippo
X set -A Extra ""
X
X # Set up counter for array
X Count=0
X
X # Create array from file
X while read -r
X do
X Extra[$Count]=`print -r $REPLY`
X ((Count=$Count+1))
X done <$FILEPATH/${1}
X
X # Test to see if the popup was created
X if [[ ! -z "$POPUP" ]]
X then
X # Since we found the popup here, make sure that
X # it is a new file
X gv $POPUP title:TITLE
X if [[ "$TITLE" != "${1}" ]]
X then
X for i in $IdList
X do
X dw W$i
X done
X else
X # It's the same as the last popup
X Same=1
X fi
X # Pop it down anyway
X pd $POPUP
X else
X # Create the popup window
X cps POPUP ${1} topLevelShell $TOPLEVEL
X sv $POPUP allowShellResize:true
X
X typeset -u PF=${1}
X
X # Now create a form
X if [[ "$UWVersion" = "4.2MP" ]]
X then
X cmw POPFORM $PF panedWindow $POPUP
X else
X cmw POPFORM $PF form $POPUP \
X noResize:false \
X resizePolicy:RESIZE_ANY
X fi
X
X # create a scrolling thing
X cmw PWINDOW pwindow scrolledWindow $POPFORM \
X scrollingPolicy:AUTOMATIC \
X visualPolicy:VARIABLE
X if [[ "$UWVersion" != "4.2MP" ]]
X then
X sv $PWINDOW topAttachment:ATTACH_WIDGET
X sv $PWINDOW rightAttachment:ATTACH_WIDGET
X sv $PWINDOW leftAttachment:ATTACH_WIDGET
X sv $PWINDOW topWidget:$POPFORM
X sv $PWINDOW leftWidget:$POPFORM
X sv $PWINDOW rightWidget:$POPFORM
X fi
X
X gv $PWINDOW width:WinWidth
X
X # Create the rowColumn widget
X cmw POPRC popRc rowColumn $PWINDOW
X sv $POPRC radioBehavior:true
X sv $POPRC packing:PACK_COLUMN
X sv $POPRC numColumns:1
X
X # Figure out the widget Number
X ((WidNum=${POPRC##W}+1))
X
X # Setup num for widget deletion
X WidgetDelete=$WidNum
X
X crtseparatorg PSEP $POPFORM psep
X if [[ "$UWVersion" != "4.2MP" ]]
X then
X sv $PSEP topAttachment:ATTACH_WIDGET
X sv $PSEP topWidget:$PWINDOW
X sv $PSEP leftAttachment:ATTACH_WIDGET
X sv $PSEP leftWidget:$POPFORM
X sv $PSEP rightAttachment:ATTACH_WIDGET
X sv $PSEP rightWidget:$POPFORM
X sv $PSEP height:5
X fi
X
X crtpushbg CLOSE $POPFORM CLOSE activateCallback:"Close_CB $POPUP"
X
X if [[ "$UWVersion" != "4.2MP" ]]
X then
X sv $CLOSE topAttachment:ATTACH_WIDGET
X sv $CLOSE topWidget:$PSEP
X sv $CLOSE leftAttachment:ATTACH_WIDGET
X sv $CLOSE leftWidget:$POPFORM
X sv $CLOSE rightAttachment:ATTACH_WIDGET
X sv $CLOSE rightWidget:$POPFORM
X sv $CLOSE bottomAttachment:ATTACH_WIDGET
X sv $CLOSE bottomWidget:$POPFORM
X fi
X fi
X
X # Test to see if this is a new menu
X if [[ "$Same" != "1" ]]
X then
X # Set all these to be safe
X WidLine=""
X WidInfo=""
X WidId=""
X IdList=""
X Width=0
X Loop=0
X while [ $Loop -lt ${#Extra[@]} ]
X do
X typeset -u I=${Extra[$Loop]%% *}
X if [[ "${I}" != "SEPARATOR" ]]
X then
X crttoggleb $I $POPRC "${Extra[$Loop]% *}"
X # This will get the number of each widget
X # created. This is necessary when having
X # multiple files (menus) to open due to the
X # way widget handles are free'd under wksh
X WidLine=`widlist |grep "${Extra[$Loop]% *}"`
X WidInfo=${WidLine#* W}
X WidId=${WidInfo%% *}
X IdList="$WidId $IdList"
X sv W$WidId valueChangedCallback:"Selected_CB ${Extra[$Loop]##* } $WidId"
X gv W$WidId width:ww
X if [[ $ww -gt $Width ]]
X then
X Width=$ww
X fi
X else
X crtseparatorg $I $POPRC fsep
X fi
X ((Loop=$Loop+1))
X ((WidNum=$WidNum+1))
X done
X
X # Dont ask me why this works, but it does!
X if [[ "$UWVersion" = "4.2MP" ]]
X then
X ((Width=$Width+(20*2)+($WinWidth/20)))
X else
X ((Width=$Width+(16*2)+($WinWidth/16)))
X fi
X
X # Set the height and width of the popup window
X if [[ "$UWVersion" = "4.2MP" ]]
X then
X sv $POPUP height:200
X sv $POPUP width:$Width
X sv $PWINDOW height:150
X else
X sv $PWINDOW height:200
X sv $PWINDOW width:$Width
X fi
X
X # We need a title
X sv $POPUP title:${1}
X sv $POPUP iconName:${1}
X fi
X
X # Popup the display
X pu $POPUP
}
X
# Check to see if main exists
if [[ ! -r $FILEPATH/main ]]
then
X echo "No main file!"
X exit 1
fi
X
# Read in the initial file for menu selecions
Count=0
while read -r
do
X Description[$Count]=`print -r $REPLY`
X ((Count=$Count+1))
done <$FILEPATH/main
X
# initialize the toolkit
ai TOPLEVEL toplevel "UnixWare Finger Info" toplevel "@"
X
# Create form widget
if [[ "$UWVersion" = "4.2MP" ]]
then
X cmw FORM form panedWindow $TOPLEVEL
else
X cmw FORM form form $TOPLEVEL
fi
X
# create a scrolling thing
cmw WINDOW window scrolledWindow $FORM \
X scrollingPolicy:AUTOMATIC \
X visualPolicy:VARIABLE
if [[ "$UWVersion" != "4.2MP" ]]
then
X sv $WINDOW topAttachment:ATTACH_WIDGET
X sv $WINDOW rightAttachment:ATTACH_WIDGET
X sv $WINDOW leftAttachment:ATTACH_WIDGET
X sv $WINDOW topWidget:$FORM
X sv $WINDOW leftWidget:$FORM
X sv $WINDOW rightWidget:$FORM
fi
X
X gv $WINDOW width:WinWidth
X
# Create rowColumn widget
cmw SELECTIONS selections rowColumn $WINDOW
sv $SELECTIONS radioBehavior:true
sv $SELECTIONS packing:PACK_COLUMN
sv $SELECTIONS numColumns:1
X
# Create the toggle button for each menu item including
# the callback.
Width=0
Loop=0
while (($Loop<${#Description[@]}))
do
X ((WidId=$Loop+4))
X typeset -u I=${Description[$Loop]%% *}
X if [[ "$I" != "SEPARATOR" ]]
X then
X crttoggleb $I $SELECTIONS "${Description[$Loop]% *}" \
X valueChangedCallback:"Selected_CB ${Description[$Loop]##* } $WidId"
X # Determine the widest string
X gv W$WidId width:ww
X if (($ww>$Width))
X then
X Width=$ww
X fi
X else
X crtseparatorg $I $SELECTIONS fsep
X fi
X ((Loop=$Loop+1))
done
X
gv $SELECTIONS width:SelectWidth
X
# Dont ask me why this works, but it does!
((Width=$Width+($SelectWidth*2)+($WinWidth/$SelectWidth)))
X
sv $WINDOW height:400
sv $WINDOW width:$Width
X
crtseparatorg SEP $FORM fsep
if [[ "$UWVersion" != "4.2MP" ]]
then
X sv $SEP topAttachment:ATTACH_WIDGET
X sv $SEP topWidget:$WINDOW
X sv $SEP leftAttachment:ATTACH_WIDGET
X sv $SEP leftWidget:$FORM
X sv $SEP rightAttachment:ATTACH_WIDGET
X sv $SEP rightWidget:$FORM
X sv $SEP height:5
fi
X
crtpushbg QUIT $FORM QUIT activateCallback:"Quit_CB"
if [[ "$UWVersion" != "4.2MP" ]]
then
X sv $QUIT topAttachment:ATTACH_WIDGET
X sv $QUIT topWidget:$SEP
X sv $QUIT leftAttachment:ATTACH_WIDGET
X sv $QUIT leftWidget:$FORM
X sv $QUIT rightAttachment:ATTACH_WIDGET
X sv $QUIT rightWidget:$FORM
X sv $QUIT bottomAttachment:ATTACH_WIDGET
X sv $QUIT bottomWidget:$FORM
fi
X
# Realize the widget
rw $TOPLEVEL
ml
SHAR_EOF
chmod 0755 Finger ||
echo 'restore of Finger failed'
Wc_c="`wc -c < 'Finger'`"
test 13873 -eq "$Wc_c" ||
echo 'Finger: original size 13873, current size' "$Wc_c"
fi
# ============= Quakes ==============
if test -f 'Quakes' -a X"$1" != X"-c"; then
echo 'x - skipping Quakes (File already exists)'
else
echo 'x - extracting Quakes (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'Quakes' &&
Washington and Oregon quake@geophys.washington.edu
Alaska quake@fm.gi.alaska.edu
Southern California quake@scec2.gps.caltech.edu
Eastern MO and Southern Illinois quake@slueas.slu.edu
Nevada and Eastern California quake@seismo.unr.edu
Northern California quake@andreas.wr.usgs.gov
Utah Wyoming Montana quake@eqinfo.seis.utah.edu
Hawaii quake@tako.wr.usgs.gov
UNITED STATES guake@gldfs.cr.usgs.gov
WORLD spyder@dmc.iris.washington.edu
SHAR_EOF
chmod 0644 Quakes ||
echo 'restore of Quakes failed'
Wc_c="`wc -c < 'Quakes'`"
test 433 -eq "$Wc_c" ||
echo 'Quakes: original size 433, current size' "$Wc_c"
fi
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
echo 'x - skipping README (File already exists)'
else
echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
Finger version 1.1
X
Finger information from selected servers. Based upon a csh
script written by Scott Yanoff (yanoff@csd4csd.uwm.edu)
Future enhancements will include the ability to add selections to
the current menus using text fields and better attachments of
widgets (what do I know about widgets, practice makes better).
X
All menu files are flat text files which take the form of:
Site Description login@to.be.fingered
Menu Description FileName
X
Additionaly, using the word "separator" within the menu
file will cause a separator gadget to be placed in that
location on the scrolling window. This is usefull for
seprating menus from locations (Thanks JTruher).
X
If you look edit the file main and search for "Earthquake
Info Menu" you will see the word Quakes as the last entry,
this indicates that there is an additional file to use for
a menu. Menus can point to menus. Remember that since this
is shell some characters will cause failures when reading
menus. If you get an error while reading a menu file, check
to see if there are any special characters or reserved words
used by the shell.
X
If there is an environment variable called FILEPATH defined,
then Finger will assume that this is where the menu files
reside. If there is en environment variable called LPCMD
then Finger will assume this to be your print command.
X
X
To install Finger:
X
(The following assumes that you untarred all files
X in the same directory)
X
As root run ./install
X
You can optionally setup 2 environment variables:
X
FILEPATH
LPCMD
X
FILEPATH is the path to the directory where the menu
files exist:
X
FILEPATH=/usr/X/lib/Finger
X
LPCMD is the command you use to send a document to
your favorite printer:
X
LPCMD="lp -o nobanner -d laser"
X
Both of these can be edited directly in the script or
can be added to your .profile.
X
X
Enjoy
X
Eric Wallengren
(Eric_Wallengren@Novell.COM)
SHAR_EOF
chmod 0644 README ||
echo 'restore of README failed'
Wc_c="`wc -c < 'README'`"
test 1872 -eq "$Wc_c" ||
echo 'README: original size 1872, current size' "$Wc_c"
fi
# ============= Weather ==============
if test -f 'Weather' -a X"$1" != X"-c"; then
echo 'x - skipping Weather (File already exists)'
else
echo 'x - extracting Weather (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'Weather' &&
Milwaukee Forecast - includes storm reports weather@csd4.csd.uwm.edu
Wisconsin State state@wisc.edu
Wisconsin Summary (statewide) summary@wisc.edu
Climate Info for Today & Yesterday - hi/lo/normal, sunrise/sunset climate@wisc.edu
Weather Info for Wisconsin Cities cities@wisc.edu
Wisconsin Precipitation Map precipitation@wisc.edu
Wisconsin Wind Map wind@wisc.edu
Wisconsin Temperatures Map temperature@wisc.edu
Wisconsin Radar Map radar@wisc.edu
Detroit Forecast weather@madlab.sprl.umich.edu
Colorado Forecast weather@rap.ucar.edu
Indiana Forecast/Bloomington Weather weather@indiana.edu
Washington Forecast weather@halcyon.com
Alabama - Auburn Forecast weather@awis.auburn.edu
Pensacola FL Forecast beach@awis.auburn.edu
Youngstown OH and Vicinity Forecast weather@ysu.edu
Oregon Forecast weather@ats.orst.edu
Massachusetts - Boston Forecast weather@cirrus.mit.edu
SHAR_EOF
chmod 0644 Weather ||
echo 'restore of Weather failed'
Wc_c="`wc -c < 'Weather'`"
test 868 -eq "$Wc_c" ||
echo 'Weather: original size 868, current size' "$Wc_c"
fi
# ============= install ==============
if test -f 'install' -a X"$1" != X"-c"; then
echo 'x - skipping install (File already exists)'
else
echo 'x - extracting install (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'install' &&
#!/usr/bin/sh
X
# Installation utility for Finger
X
# This is where Finger will end up
DEST=/usr/X
X
# Defined filepath as read from Finger
S="FILEPATH=/usr/X/lib/Finger"
R="FILEPATH=$DEST/lib/Finger"
X
# First, who am I
id |awk '{print $1}'|grep root >/dev/null 2>&1
X
# Was the user root?
if [ $? -ne 0 ]
then
X echo "You must be root to complete installation"
X exit 1
fi
X
# Do the destination directories exist?
if [ ! -d $DEST/bin ]
then
X mkdir $DEST/bin
fi
if [ ! -d $DEST/lib/Finger ]
then
X mkdir -p $DEST/lib/Finger
fi
X
# Copy the script to $DEST/bin
echo "Copying Finger to $DEST/bin"
echo
cp Finger $DEST/bin/Finger
X
# Make sure that Finger is executable
chmod 755 $DEST/bin/Finger
X
echo "Copying menu files to $DEST/lib/Finger"
echo
for i in main Quakes Weather
do
X cp $i $DEST/lib/Finger
done
X
if [ "$S" != "$R" ]
then
X echo "You will need to set up an envrioment variable"
X echo "called FILEPATH and have it set to:"
X echo
X echo "$DEST/lib/Finger"
fi
X
echo
echo "Installation complete"
SHAR_EOF
chmod 0755 install ||
echo 'restore of install failed'
Wc_c="`wc -c < 'install'`"
test 992 -eq "$Wc_c" ||
echo 'install: original size 992, current size' "$Wc_c"
fi
# ============= main ==============
if test -f 'main' -a X"$1" != X"-c"; then
echo 'x - skipping main (File already exists)'
else
echo 'x - extracting main (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'main' &&
Auroral Activity aurora@xi.uleth.ca
Three Hour Solar and Geophysical Report solar@xi.uleth.ca
Daily Solar and Geophysical Report daily@xi.uleth.ca
List of Periodic Postings to Usenet nichol@stavanger.sgp.slb.com
Animaniacs Future Episode Lists hendry@helios.physics.utoronto.ca
DataBases via Finger help@dir.su.oz.au
separator
Earthquake Info Menu Quakes
separator
NASA Headline News nasanews@space.mit.edu
Solar Radio Flux solar@drao.nrc.ca
Wisconsin Scores/Standings yanoff@csd4.csd.uwm.edu
Tropical Storm Forecast forecast@typhoon.atmos.colostate.edu
Remote Andrew Demo Service for X help@atk.itc.cmu.edu
Cable Regulation Digest higgins@dorsai.dorsai.org
Seattle Radio News & Information none briang@halcyon.com
Pauls Hottub hottub@paulh.pnet.msen.com
SpaceNews magliaco@pilot.njin.net
Code of the Geeks hayden@vax1.mankato.msus.edu
The Kitchen PAC in NYC kitchen@panix.com
Coke Machine at Berkeley coke@xcf.berkeley.edu
Coke Machine in CS House at RIT drink@drink.csh.rit.edu
Graph of soda at RIT graph@drink.csh.rit.edu
Coke Machine at CMU coke@cs.cmu.edu
Pepsi Machine at Columbia pepsi@columbia.edu
Coke Machine at Columbia cocacola@columbia.edu
Almanac Info/Sports Schedules copi@oddjob.uchicago.edu
Nova U's Grad. Catalog cciscat@alpha.acast.nova.edu
Baseball Scores/Standings mlb@spam.wicat.com
NFL Scores/Standings nfl@spam.wicat.com
NFL Line Spread nflline@spam.wicat.com
Weekly Trivia cindiw@magnus1.com
Most Powerful Computing Sites gunter@yarrow.wt.uwa.edu.au
Talk bizarre Stories richh@flode.nvg.unit.no
ASCII Art FAQ boba@gagme.wwa.com
Cyber Sleaze Daily Report adam@mtv.com
separator
US Weather Info Menu Weather
separator
ARTS Pace On-line Magazine mjrst+@pitt.edu
SHAR_EOF
chmod 0644 main ||
echo 'restore of main failed'
Wc_c="`wc -c < 'main'`"
test 1684 -eq "$Wc_c" ||
echo 'main: original size 1684, current size' "$Wc_c"
fi
exit 0
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads