wood burning stoves 2.0
The moose likes Linux / UNIX and the fly likes sqlplus and shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "sqlplus and shell script" Watch "sqlplus and shell script" New topic

sqlplus and shell script

Rahuul Dravid
Ranch Hand

Joined: Feb 17, 2009
Posts: 42
Hi Folks,

I have a some issues with calling sqlplus form shell script.
I can run the sqlplus command form the home of the user directory ( i set the alias for sqlplus by editing the .bash_profile of that user ....every thing is fine.
home:> sqlplus
I can connect to db

Now when i try to run the same sqlplus from the a shell script like 1.sh with sqlplus command inside the 1.sh

it says command not found .

i tried to edit the even the etc/bashrc file but .... it is same

So how to fix this so that the sh can get the path variable in linux ( red hat AS 5)

Do i need to edit define any variables ???

I think i set the Path correctly , if not it should not work from the home directory i guesss .....correct me if i'm wrong !

Thanks in advance !
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16537

Issue the command "which sqlplus". It will display the full pathname of the executable. You should be able to invoke sqlplus from a script if you use the full pathname.

Customer surveys are for companies who didn't pay proper attention to begin with.
Rahuul Dravid
Ranch Hand

Joined: Feb 17, 2009
Posts: 42

Thanks for the reply Tim

well i think i figured it out , there is the path issues .....and now it is fixed !

Thanks guys !

jQuery in Action, 2nd edition
subject: sqlplus and shell script