Regarding executing commands in "new" directories: If you do set you'll get environmental info including: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/usr/local/lib/ICAClient All commands in your Path directories do not require ./ (Incidentally compare ls ./ and ls ../ ) But if any unix like system, ./thiscommand means execute thiscommand within this directory rather than searching the Path. Alternative you could set up a symbolic from some directory on your path such as: ln -s /usr/local/lib/wpbin/xwp /usr/local/bin/wp Thereafter wp would suffice to initiate wordperfect from any directory. See also fancier alternatives discussed in the attachment. MarvS ============================== > You have to type ./xwp, not xwp. A simple but strange annoyance. > > Leon
ftp://ftp.tux.org/pub/people/greg-pryzby/GUILG00.GZ ------------------ > The only downfall to this is you can't pass command line parameters. How about #!/bin/sh /opt/wp/wpbin/xwp $@ & very good! in fact, i'm going to change the script... can i use your tip in the second edition of Teach Yourself Linux? (i'll give you credit)... -------------- josh - quite true... although i don't need cmd-line opts for wp, perhaps: /opt/wp/wpbin/xwp $1 $2 $3 $4 $5 & would be better? --------------- Better yet: #!/bin/sh PATH=/opt/wp/wpbin:$PATH export PATH exec xwp "${@-}" ## NOTREACHED ## The "${@-}" is the precise notation for adding in all parameters exactly as they came in, and not failing if there are none even if you have set -u on. $@ within double quotes has special meaning, the double quotes are needed in most shell implementations. ------------- One thing that I had to add to mine is an extra statement to remove the environment variable LD_LIBRARY_PATH. When I run xwp with a setting for that variable, I get a seg fault. Removing the variable setting though works fine. -------------- OK, and there's been some noise on BUGTRAQ about some stuff wp likes to create in /tmp (world-writable files, dirs, follows sym links, the usual stuff). So here's another script to cover the concerns so far. I just posted this to BUGTRAQ, maybe it'll show up, maybe not. But my thanks to Billy, Bruce, and David for their ideas. #!/bin/sh # Set $TMPDIR to ~/tmp if the user doesn't already have a TMPDIR variable if [ "${TMPDIR}" = "" ]; then #Niermi says: This will break for some values of TMPDIR, the ideal way to do this is: # if [ -z "${TMPDIR-}" ]; then TMPDIR=${HOME}/tmp fi if [ ! -d "${TMPDIR}" ]; then # Need to make a new directory TMPDIR_TEST="error" /bin/mkdir "${TMPDIR}" && TMPDIR_TEST="ok" if [ ${TMPDIR_TEST} != "ok" ]; then /bin/echo "Unable to create safe tmp directory ${TMPDIR}" exit 1 fi /bin/chmod o= "${TMPDIR}" fi # Set $TMPDIR for the wpc-$HOSTNAME junk export TMPDIR # Clear LD_LIBRARY_PATH to prevent reported seg faults LD_LIBRARY_PATH="" export LD_LIBRARY_PATH # Set the PATH and exec the app, passing any command-line args PATH=${PATH}:/path/to/wordperfect/wpbin export PATH exec xwp "${@-}" & ======================= On Mon, 21 Dec 1998, Joseph S D Yao wrote: > > "William H. Ball" wrote: > > > i created a short text file containing: > > > > > > /opt/wp/wpbin/xwp & > > > > > > named the file wp, did a chmod +x, then copied it to /usr/local/bin... > > > works perfectly! > > > > The only downfall to this is you can't pass command line parameters. > > But a slight mod fixes that. > /opt/wp/wpbin/xwp $@ & > Here, each argument is passed on as a separate argument. The only > problem is, if you had arguments that had to be enquoted (e.g., > "has spaces"), then the quoting disappears. This can be put back in; > but it takes much more active work. (I.e., it's no longer a > one-liner.) Ah, but try "$@" instead of $@ (or ideally "${@-}" ). ====================================== > Make that > if [ "${TMPDIR}" = "" ]; then > Sorry. Better yet: if [ "" = "${TMPDIR}" ]; then ... I always put the constant first, in a shell script comparison. That way, even if the variable somehow started out with "-" or some other character recognized by 'test' ["!"?], then it's still interpreted correctly. =============== ========== Subject: Re: Corel WP8 printing problems Date: Mon, 21 Dec 1998 10:26:06 -0500 From: Bill Voight <[EMAIL PROTECTED]> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Newsgroups: comp.os.linux.misc, comp.os.linux.setup, linux.redhat.misc References: 1 Sports fans, Thanks to all for the replies. Turns out the solution was ridiculously simple. I selected "Print Document Graphically" under File/Print/Output Options. Everything seems to be running just fine for now (till I hose it again).
--- http://nts.ml.org FAQ: http://www.ps.uci.edu/~tomba/inspiron/ http://nts.ml.org/inspiron/ List Archives: http://nts.ml.org/inspiron/maillist.html To unsubscribe send a message to: [EMAIL PROTECTED] List administrator: [EMAIL PROTECTED]
