shell scripts and directories?

Robert Bushman plug-discuss@lists.plug.phoenix.az.us
Sun, 21 Jul 2002 20:05:22 -0400 (EDT)


I've got a startup script for a deamon I'm using,
which looks like this:

#!/bin/sh
./squeak -headless squeak.image start.st &

Works great. Problem is, squeak, squeak.image,
and start.st are all files. squeak is an
executable, so I can link it from /usr/bin.
squeak.image can be referenced absolutely
(/usr/local/lang/squeak/squeak.image). But
when I reference start.st absolutely, it
doesn't work. I could softlink start.st in
/etc/rc.d/init.d, but that seems like an
unprofessional solution.

So I tried:

#!/bin/sh
cd /usr/local/lang/squeak/apps/swiki/
./swiki.sh

and put swiki.sh and start.st in the apps/swiki
directory, but no dice. It can't find swiki.sh,
so I'm assuming the cd isn't doing what I think
it should.

So what am I doing wrong? How do I cd within a
shell script?