diff options
author | Tommy Reynolds <Tommy.Reynolds@MegaCoder.com> | 2006-01-16 05:49:23 +0000 |
---|---|---|
committer | Tommy Reynolds <Tommy.Reynolds@MegaCoder.com> | 2006-01-16 05:49:23 +0000 |
commit | 8d231d0836c307a56c96fd3c31f4c190322a2e6d (patch) | |
tree | f9c5ba717a662721471dde166c1931d4154bbc71 /bin | |
parent | ee7376e7040c4f3382fa567acb36920ddc0749b7 (diff) | |
download | fedora-doc-utils-8d231d0836c307a56c96fd3c31f4c190322a2e6d.tar.gz fedora-doc-utils-8d231d0836c307a56c96fd3c31f4c190322a2e6d.tar.xz fedora-doc-utils-8d231d0836c307a56c96fd3c31f4c190322a2e6d.zip |
1) Make compatible with Bourne shell, bash, korn shell, and Z-Shell.
2) Redirections now work correctly in all modes. So do pipes, (),
and the like.
3) Set ${SHELL} environment parameter so that subshells inherit the
". fdp-functions" environment.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fdpsh | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ######################################################################## # Fedora Documentation Project Interactive Shell # @@ -10,10 +10,16 @@ # With neither a "-c" switch or command line arguments, commands are # accepted from stdin. ######################################################################## -ME=$(basename $0) -MYDIR=$(dirname $0) +ME=`basename $0` +FDPBINDIR=`dirname $0` USAGE="usage: ${ME} [-c cmd] [file [arg..]]" -. ${MYDIR}/fdp-functions +# +PATH=${FDPBINDIR}:${PATH} export PATH +FDPDIR=${FDPBINDIR}/../.. export FDPDIR +SHELL=${FDPBINDIR}/${ME} export SHELL +# +. ${FDPBINDIR}/fdp-functions +# CMD= while getopts c: c do @@ -23,10 +29,10 @@ do esac done if [ "${CMD}" ]; then - ${CMD} + eval ${CMD} results=$? elif [ $# -gt 0 ]; then - $@ + eval $@ results=$? else while : @@ -34,7 +40,7 @@ else echo -n "${ME}> " >&2 read -e cmd if [ "${cmd}" ]; then - ${cmd} + eval ${cmd} results=$? if [ ${results} -gt 0 ]; then echo "Status = ${results}" >&2 |