urgent help needed.

Ok I admit it I am stumped and I would appreciate any and all help

Here is what I am trying to do.

Korn Shell script

I am setting a variable to another shell script that I want to invoke in my main script like so:

GETDIR=/vol100/cfg/.getdir

The .getdir shell script take a parameter, for example:

./getdir somedir

This returns a single entry.

I set another variable in the main script to the parameter
PARAM=someparameter

Now inside my main script I want to get the result of running the .getdir script with the parameter

And I am trying to do this like so

NETDIR=$(${GETDIR} ${PARAM})
echo ${NETDIR}

But it doesn't work ${NETDIR} is always empty.

Any suggestions?

Thanks,

Batch

First , is the name of the script you are calling .getdir or just getdir? Your example command says ./getdir somedir, but you refer to it as .getdir in your variable and comment.
If that's just a typo, it looks to me that there may be a discrepancy on what getdir does and/or takes as input and what you are asking it to do. In your example, getdir takes a directory as input, but in your script, you pass a parameter. Is this parameter a directory? Maybe getdir expecting a path and your parameter is just a name (or vise versa)?

This part has the proper syntax to work:

NETDIR=$(${GETDIR} ${PARAM})
echo ${NETDIR}

Sorry it is a hidden file so it is .getdir And the parameter that it takes is just a hashed value of some text and the .getdir script unhashes it.

When I run the .getdir script in the console with the parameter it works fine. But as I said it doesnt seem to be doing anything in the main script. I was very curious about the syntax of that line that you quoted and I thank you for your reply.

-Batch

try putting a set -x on the line before and a set +x on the line after so you can see exactly what happens on that line.

It was a permissions problem. Thanks for all your help.