docs-common/bin fdpsh,1.1,1.2
Tommy Reynolds (jtr)
fedora-docs-commits at redhat.com
Mon Jan 16 05:49:30 UTC 2006
Author: jtr
Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8270
Modified Files:
fdpsh
Log Message:
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.
Index: fdpsh
===================================================================
RCS file: /cvs/docs/docs-common/bin/fdpsh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- fdpsh 16 Jan 2006 01:58:12 -0000 1.1
+++ fdpsh 16 Jan 2006 05:49:23 -0000 1.2
@@ -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 @@
esac
done
if [ "${CMD}" ]; then
- ${CMD}
+ eval ${CMD}
results=$?
elif [ $# -gt 0 ]; then
- $@
+ eval $@
results=$?
else
while :
@@ -34,7 +40,7 @@
echo -n "${ME}> " >&2
read -e cmd
if [ "${cmd}" ]; then
- ${cmd}
+ eval ${cmd}
results=$?
if [ ${results} -gt 0 ]; then
echo "Status = ${results}" >&2
More information about the Fedora-docs-commits
mailing list