LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question on Shell Script (https://www.linuxquestions.org/questions/linux-newbie-8/question-on-shell-script-4175464896/)

manickaraja 06-05-2013 06:29 PM

Question on Shell Script
 
Hi,
I am having a shell script with similar content as shown below.

export ORACLE_HOME1=${data.GI_ORACLE_HOME_LOC}
export ORACLE_HOME2=${data.DB_ORACLE_HOME_LOC}
export USERNAME=${data.EMUserName}

Now I want to know what are other variables that are available as part of "data" data set and display all. Can some one show me the way on how to do the same? Thanks a lot for your time and help in this regard.

evo2 06-05-2013 08:04 PM

Hi,

the "env" command will list all currently defined shell/environment variables (for bourne style shells).

Evo2.

AnanthaP 06-05-2013 08:24 PM

Reading carefully, this is an Oracle question.

You can also look at an Oracle forum.

I think that it is "set" within the oracle prompt.

OK

evo2 06-05-2013 08:34 PM

Hi,
Quote:

Originally Posted by AnanthaP (Post 4966234)
I think that it is "set" within the oracle prompt.

Good catch: shell variables can't contain ".". However, the OP explicitly says it is a shell script...

Evo2.

David the H. 06-06-2013 02:30 PM

I'm assuming you want to use the value in the shell variables as parameters for a database enquiry? Well then, what's the command you want to use for doing it with a single entry?

Configure that, then wrap a loop around it and substitute the variables you want to use as the inputs.

However, you'll probably want to use an array for the shell script instead of single variables. Perhaps even an associative array.

manickaraja 06-06-2013 05:31 PM

Hi,
Thanks for all your responses. I found the answer and my question was mis-leading I suppose. Actually it was Java procedure which has the variable value assigned and within java procedure shell script is called and hence variables are passsed internally. Any ways thanks for your time & response.

Regards,
Manick.


All times are GMT -5. The time now is 06:46 PM.