I have the following script:
cd "/usr/local/bin/"
/sbin/startproc ./program1
I have a license in the /usr/local/bin
directory and if the program isn't started from there
it won't launch correctly.
The cd "/usr/local/bin"
doesn't seem to be doing the trick.
Taking a peek at startproc's man page, it looks like it wants full path.
Have you tried the cd and specifying the full directory, like so?
On thing I'd do afterwards is add the following line immediately after the startproc line;
That can tell you what error startproc is throwing, and what the problem might be, according to this exit code list for the program:
That should give you a better peek into what's up if the full path doesn't work.
You haven't said anything about the kind of system you're doing this on, but typically a utility with a name like
startproc
does its own setup — often including setting a default directory. I suggest you find your system's documentation forstartproc
and see how to make it do what you need, or failing thatstartproc
the script that changes directory.