Notes on Smart Software Ver 3.10

C. Jeffery Small jeff at cjsa.UUCP
Tue Sep 27 01:09:04 AEST 1988


After having struggled with the latest upgrade (version 3.10) of the Smart
System software for the Unix-pc, I thought that I would share a few of my
observations.

In the previous version, if any user on the system made a change to any of
the Parameter, Configure or Preset files, then these changes were global
for everyone else.  In the new release, an attempt has been made to solve
this problem by allowing the "Smartmgr" entry in the "Office" to create
a set of personal configuration files for each user.  However, where do
all of these files get dumped?  Why, in your $HOME directory of course!
Now, if you're just using the User Agent Office, then you never see your
home directory.  But, since most of us work in the shell, you don't want
all of these files lying around in your way.  However, you just can't go
moving these things around without causing all sorts of problems and that
is the problem I went about trying to solve.

There is a new  "-sPATH"  command line option for all of the smart modules
which allow you to specify a new location for all of those support files
which are (by default) located in /usr/bin/smart (and what are they doing
there anyway!)  I decided that on my machines, I would have a directory for
each user called $HOME/SMART where the personal copies of the support files
would go.  (You could substitute any path you like.) I found that once you
moved the Smart files out of $HOME, you had to have copies of ALL of the
/usr/bin/smart files in the new location.  I decided to fix the "Smartmgr"
to address this problem so that new users could create their own personal
directories with links and copies to the necessary files.

When you select "Smartmgr" from the "Office", you run the script
"/usr/bin/smartmgr".  Selection No. 1 allows you to create your personal
copy of the smart files.  When you select this, you run the script
"/usr/bin/smart/scripts/cpsd".  I replaced this with my own modified script
which does what I want it to.  In the attached shar, I have included my
revised script (called "mycpsd") for your use or study.  If you compare
it to the original, you will see that I pulled out the part which copies
the tutor example files and handled that elsewhere.  To use this file,
you must install it as /usr/bin/smart/scripts/cpsd.

OK - now you have the files where you want them, but you have to tell Smart
about the new location.  To do this, you have to modify the commands in
both the $UA/Office and $UA/Suffixes files to specify the "-s" flag.
Attached is a script called fix.smart.sfx which makes all of the necessary
corrections to these files including fixing a typo supplied by Smart
where they spell their name "samrt"!  That command was never gonna' run.
If you specify a different location for the files other than $HOME/SMART,
don't forget to update this script before you run it. 

OK - now the User Agent knows how to properly run Smart.  But you don't use
the UA right?  Well, here are the functions I define in my .kshrc file to
run this stuff from the shell using windy to give me a separate window for
each process.

  alias ua='windy -b -n "Office of Jeff" /usr/bin/ua'
  function db { if [ "$#" = "0" ]
	        then
		  windy -b -n "Smart db:"    /usr/bin/smartdb d -s$HOME/SMART \
				variable-length no-password new
	        elif [ -s $1 ]
	        then
		  windy -b -n "Smart db: $1" /usr/bin/smartdb d -s$HOME/SMART \
				-aload $1 screen standard
	        else
		  windy -b -n "Smart db: $1" /usr/bin/smartdb d -s$HOME/SMART \
				-acreate file $1 variable-length no-password new
	        fi ; }
  function ss { if [ "$#" = "0" ]
	        then
		  windy -b -n "Smart ss:"    /usr/bin/smartss s -s$HOME/SMART
	        elif [ -s $1 ]
	        then
		  windy -b -n "Smart ss: $1" /usr/bin/smartss s -s$HOME/SMART \
				-aload $1
	        else
		  windy -b -n "Smart ss: $1" /usr/bin/smartss s -s$HOME/SMART \
				-anewname $1
	        fi ; }
  function vi  { windy -b -n "vi:       $1" /usr/bin/vi $* ; }
  function wp { if [ "$#" = "0" ]
	        then
		  windy -b -n "Smart wp:"    /usr/bin/smartwp w -s$HOME/SMART
	        elif [ -s $1 ]
	        then
		  windy -b -n "Smart wp: $1" /usr/bin/smartwp w -s$HOME/SMART \
		  -s$HOME/Filecabinet/Misc/Smart -aload $1
	        else
		  windy -b -n "Smart wp: $1" /usr/bin/smartwp w -s$HOME/SMART \
				-anewname $1
	        fi ; }


This is only one of a number of problems I have discovered so far.  Has anyone
figured out how to conveniently support more than one printer without having
to re-Configure from the Main-Menu?

Cheers.
--
Jeffery Small    (206) 485-5596            uw-beaver!uw-nsr!uw-warp
C. Jeffery Small and Associates                                    !cjsa!jeff
19112 152nd Ave NE - Woodinville, WA  98072           uunet!nwnexus


------------- cut here -----------------------------------------------------
# This is a shell archive.  Remove anything before this line
# then unpack it by saving it in a file and typing "sh file"
# (Files unpacked will be owned by you and have default permissions).
# This archive contains the following files:
#	./fix.smart.sfx
#	./mycpsd
#
if `test ! -s ./fix.smart.sfx`
then
echo "extracting ./fix.smart.sfx ..."
sed 's/^X//' > ./fix.smart.sfx << 'END__of_the__FILE'
X#########################################################################
X#									#
X# File:			fix.smart.sfx		(Bourne Shell Script)	#
X# Version:		1.1						#
X#									#
X# Original Coding:	C. Jeffery Small		Date: 09-19-88	#
X# Latest Revision:	C. Jeffery Small                Date: 09-26-88  #
X#									#
X# SYNOPSIS								#
X#	fix.smart.sfx							#
X#									#
X# REQUIREMENTS								#
X#	This applies ONLY to Smart version 3.10.			#
X#									#
X# DESCRIPTION								#
X#	This script is used to modify the Smart entries in the Suffixes	#
X#	and Office files to use the new Version 3.10 "-s" option which	#
X#	allows a user to specify a new directory  [other than the	#
X#	default of /usr/bin/smart] as the location of the driver files.	#
X#	If this system-wide option is to be used, then you want to	#
X#	update these files so that the Office still works with smart.	#
X#									#
X#	We also fix a mispelling in the Suffixes file put there by the	#
X#	creators of Smart!  Now that's quality control.			#
X#									#
X#	You must be super-user (ie root) to execute this program.	#
X#									#
X#########################################################################
X
XOFFICE=/usr/lib/ua/Office
XSFX=/usr/lib/ua/Suffixes
XTMP=/tmp/sm$$
X
Xtrap "rm -f $TMP" 0 1 2 3 15
X
X
XSMARTDIR="SMART"	# This is the directory name under $HOME where
X			# the smart driver files will reside for each user.
X
Xecho `id` | grep 'root' > /dev/null
X
Xif [ "$?" != "0" ]
Xthen
X    echo "$0:  Sorry.  You must be root to run this program.  Bye."
X    exit 1
Xfi
X
Xcat $SFX | sed "/samrt/s/samrt/smart/" | \
Xsed "/smart.. /s/-a/-s\$HOME\/$SMARTDIR -a/"  > $TMP
X
Xmv   $TMP $SFX
Xchown bin $SFX
Xchgrp bin $SFX
Xchmod 644 $SFX
X
Xcat $OFFICE | sed "/smartmn/s/.*/& -s\$HOME\/$SMARTDIR/" > $TMP
X
Xmv   $TMP $OFFICE
Xchown bin $OFFICE
Xchgrp bin $OFFICE
Xchmod 644 $OFFICE
END__of_the__FILE
if test `wc -c < ./fix.smart.sfx` -ne 1811 
then
    echo "\tWAIT A MINUTE ... Expecting file size of     1811 bytes"
    echo "\t                  but got a file size of  `wc -c < ./fix.smart.sfx` bytes"
    echo "\tWARNING ......... Suggest you check file contents."
fi
else
  echo "will not over write ./fix.smart.sfx"
fi
if `test ! -s ./mycpsd`
then
echo "extracting ./mycpsd ..."
sed 's/^X//' > ./mycpsd << 'END__of_the__FILE'
X# File: /usr/bin/smart/scripts/mycpsd
X#
X# Modified version of the cpsd script -- 09-26-88
X
XSMARTDIR="$HOME/SMART"		# Place where smart driver files will be put
XWHO=$LOGNAME
X
Xif [ -d "${SMARTDIR}" ]
Xthen
X    echo "\n\n\007\007"
X    echo "    The Smart Folder  ${SMARTDIR}  exists.  It looks like this step"
X    echo "    has already been performed.  Please verify this and bring any"
X    echo "    questions you have to the attention of your system administrator."
X    echo ""
X    echo "    Hit <ENTER> to continue. \c"
X    read ANS
X    echo "    Bye!"
X    sleep 3
X    exit 0
Xelse
X    echo "\n\n    Moving files to your Personal Smart directory: ${SMARTDIR}"
X
X    ## Step #1:  Make the Personal Smart directory.
X
X    mkdir ${SMARTDIR}
X    mkdir ${SMARTDIR}/scripts
X    chmod 755   ${SMARTDIR} ${SMARTDIR}/scripts
X    chown $WHO  ${SMARTDIR} ${SMARTDIR}/scripts
X    chgrp users ${SMARTDIR} ${SMARTDIR}/scripts
X
X    ## Step #2:  Link the smart driver files to the personal directory.
X    ##		 Why have duplicates of all the files lying around??
X
X    ln /usr/bin/smart/scripts/*  ${SMARTDIR}/scripts
X    ln /usr/bin/smart/*          ${SMARTDIR}         > /dev/null 2>&1
X
X    ## Step #3:  Delete links for files which must be copied.
X
X    SMARTFILES="cmdef.def cmformat.def configur dcaxlate.trn keyboard.def \
X		param1 $1 param2 $1 param3 $1 param6 $1 printer.dsc \
X		psetup.def report.def rpt.def spell.def wpprint.def"
X
X    cd ${SMARTDIR}
X    rm -f ${SMARTFILES} print[0-9][0-9].dsc
X
X    ## Step #4:  Make personal copies of customizable files for the user.
X    ##		 This includes any system-defined printer definitions.
X
X    cd /usr/bin/smart
X    cp ${SMARTFILES} print[0-9][0-9].dsc   ${SMARTDIR}
X
X    cd ${SMARTDIR}
X    chmod 644   ${SMARTFILES} print[0-9][0-9].dsc
X    chown $WHO  ${SMARTFILES} print[0-9][0-9].dsc
X    chgrp users ${SMARTFILES} print[0-9][0-9].dsc
Xfi
END__of_the__FILE
if test `wc -c < ./mycpsd` -ne 1869 
then
    echo "\tWAIT A MINUTE ... Expecting file size of     1869 bytes"
    echo "\t                  but got a file size of  `wc -c < ./mycpsd` bytes"
    echo "\tWARNING ......... Suggest you check file contents."
fi
else
  echo "will not over write ./mycpsd"
fi
echo "Finished archive 1 of 1"
# if you want to concatenate archives, remove anything after this line
exit



More information about the Comp.sys.att mailing list