Long time no post..... (I'm back from the depths of OpenBSD-hood and re-embracing my Linux roots)

Bottom Line... I got a 20 Gig hard drive to dual boot
Slackware 8.1 and OpenBSD 3.1 AND I go the
Zaurus SL5500 from Sharp (linux on board)

Here's my problem...

Whoever put together the apache-php.ipk for
the Zaurus left out the apachectl script...

Several people I have talked to have mentioned
interest in having this script...

I have copied the script from my Slackware setup,
and modified it specifically for the Z...

Now... The Zaurus has three main areas that any
program may be installed... RAM filesystem on the
device, Compact Flash adapter, or Secure Digital
(SD) Card.

I am attempting to write an sh script that can be
run to modify the apachectl variables that are
needed for it to know where the server and it's
associated PID files live.

By default, httpd is located at:
/home/www/bin/httpd

and the PID file is located at:
/home/www/logs/httpd.pid

Several people (including myself) would rather
it be installed at:
/mnt/card/www/bin/httpd
/mnt/card/www/logs/httpd.pid

(we basically install to RAM then move the www directory
to /mnt/card or /mnt/cf depending on whether it's
an SD or CF)

I want my script to modify these variables to
point to wherever the user installed it...

I am attempting to use sed inside my script and
am not having much luck.

There are two problems with the scripts:
1) When the user inputs a wrong path to
any of the three file locations asked for,
it is supposed to exit with an exit status of 1
(It doesn't.. it just moves on to the next question
rather than stopping there)

2) When it gets to the sed statements, it is
actually trying to open a file and I get this error:
./actlsetup: cannot open HTTPD: no such file
./actlsetup: cannot open PID: no such file

Here is a copy of the script:

#!/bin/sh

CTL=/usr/local/bin/apachectl
HTTPD=/home/www/bin/httpd
PID=/home/www/logs/httpd.pid

echo "Where is apachectl?"
echo "Press enter for default path: $CTL"
echo "or type its full path"

read ICTL

if [ -z $ICTL ] ; then
ICTL=$CTL
fi

if [ ! -w $ICTL ] ; then
echo "$ITCL could not be found"
exit 1
fi

echo "Where is httpd?"
echo "Press enter for default path: $HTTPD"
echo "or type its full path"

read IHTTPD

if [ -z $IHTTPD ] ; then
IHTTPD=$HTTPD
fi

if [ ! -x $IHTTPD ] ; then
echo "$IHTTPD could not be found"
exit 1
fi

echo "Where is httpd.pid?"
echo "Press enter for default path: $PID"
echo "or type its full path"

read IPID

if [ -z $IPID ] ; then
IPID=$PID
fi

if [ ! -r $IPID ] ; then
echo "$IPID could not be found"
exit 1
fi

`sed s/\#<HTTPD>\n/\#<HTTPD>\n$IHTTPD/g $ICTL`
`sed s/\#<PID>\n/\#<PID>\n$IPID/g $ICTL`

echo "Configuration complete."
echo "Run $ICTL to start, restart,"
echo "and stop apache"

#END SCRIPT

I know that the second problem lies within the
sed statements as I get different errors if I change
it a little (by adding \'s in various places hoping it's
just a special character problem)

Can anyone here check my scripting and tell me
why I'm having these problems?

Thanks...

gaxprels

PS... HI Aragorn