Running a shell script

I have a shell script who’s first line reads:
#!/bin/ksh

The problem is that at the time that this script is being run there is /bin
directory. There is however a /ram/ksh.

I know that I could ‘prefix -A /bin/ksh=/bin/ksh’ but the shell script is
going to install QNX on this file system. If I use this prefix it won’t
properly install /bin/ksh.

I know that I can use something like:
/ram/ksh myscript

But I also need to pass arguments to the script, i.e.
/ram/ksh myscript arg1 arg2

For some reason the arguments aren’t being passed to the script when being
invoked like this. How can I run this script and pass it arguments?

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:

I have a shell script who’s first line reads:
#!/bin/ksh

The problem is that at the time that this script is being run there is /bin
directory. There is however a /ram/ksh.

Make the first line read:

#!/ram/ksh

(The #! syntax tells the loader to run a particular executable and
pass this script and other options to it. It doesn’t have to be
#!/bin/ksh – it could be a shell at a different location, or it
can even be other interpreters, I write awk scripts that start with
“#!/bin/awk -f” for instance.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:

I have a shell script who’s first line reads:
#!/bin/ksh

The problem is that at the time that this script is being run there is /bin
directory. There is however a /ram/ksh.

I know that I could ‘prefix -A /bin/ksh=/bin/ksh’ but the shell script is
going to install QNX on this file system. If I use this prefix it won’t
properly install /bin/ksh.

I know that I can use something like:
/ram/ksh myscript

But I also need to pass arguments to the script, i.e.
/ram/ksh myscript arg1 arg2

For some reason the arguments aren’t being passed to the script when being
invoked like this. How can I run this script and pass it arguments?

How about:

/ram/ksh -c “myscript arg1 arg2”

-xtang

I though that should work, but it wasn’t.

If you look at the thread right before this, you’ll see I screwed up because
I was running esh and not ksh.

“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:a8ickf$5r6$1@nntp.qnx.com

“Bill Caroselli (Q-TPS)” <> QTPS@earthlink.net> > wrote:
I have a shell script who’s first line reads:
#!/bin/ksh

The problem is that at the time that this script is being run there is
/bin
directory. There is however a /ram/ksh.

I know that I could ‘prefix -A /bin/ksh=/bin/ksh’ but the shell script
is
going to install QNX on this file system. If I use this prefix it won’t
properly install /bin/ksh.

I know that I can use something like:
/ram/ksh myscript

But I also need to pass arguments to the script, i.e.
/ram/ksh myscript arg1 arg2

For some reason the arguments aren’t being passed to the script when
being
invoked like this. How can I run this script and pass it arguments?

How about:

/ram/ksh -c “myscript arg1 arg2”

-xtang