LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2016, 01:36 AM   #1
sreemannem
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Rep: Reputation: Disabled
Please help me to set the oracle_home and other variables in .bashrc file using sheel script


Hi,

below are my requirements -

1.creating user say "test"
2.changing permissions form root user to created user for specific folder
3.running the oracle script

I have done first two points but i am stopped on third point

below error message came -
sqlplus command not found

above error came because of not setting Oracle environment variable for created user

Please help me to set the oracle_home and other variables in .bashrc file using sheel script and pleae let me know how to get these variable (Oracle_home..)

Thanks in Advance
Sreedhar
 
Old 03-09-2016, 01:55 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
What part of the instructions from the Oracle web site are you getting stuck on? I believe their documentation is very complete.
 
Old 03-09-2016, 02:22 AM   #3
sreemannem
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks grail for your reply

I believe my question is not clear -

the below three points need to execute the shell script
Shell script is written for 1&2 points and its ran successfully

1.creating user say "test"
2.changing permissions form root user to created user for specific folder
3.running the oracle script

to execute 3 point, i wnat know how to edit .bashrc file of newly created user then export the oracle env variables. please help me

Thanks in Advance
Sreedhar
 
Old 03-09-2016, 02:29 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Some sort of homework?
 
Old 03-09-2016, 02:59 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
i wnat know how to edit .bashrc file of newly created user then export the oracle env variables. please help me
Which part is unclear?
 
Old 03-09-2016, 03:12 AM   #6
sreemannem
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
edit .bashrc file through shell script

Quote:
Originally Posted by pan64 View Post
Which part is unclear?
Hi Pan thanks for your reply,

I want edit .bashrc file of newly created user then export the oracle env variables using shell script
i don't know how to write the shell script for editing .bashrc file then copying the oracle env variables

Thanks
Sreedhar
 
Old 03-09-2016, 03:24 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
do you know how to edit a file? Any file. Do you know where is that .bashrc file located? What are those variables?
 
Old 03-09-2016, 03:26 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
@OP Is this some sort of homework or an examination? If so, then please quote the whole text of it.
 
Old 03-09-2016, 03:51 AM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Quote:
I believe my question is not clear
No, I found the question to be perfectly clear, hence my response is, what are you stuck on when looking at the documentation provided by Oracle to do the exact thing you are trying to do?

Others have already asked you about your file editing skills, which as you have created 2 scripts already I assumed you know how to edit a file.
So, if you read the documentation it will clearly tell you what you need to run / source to make the variables you are after available to the user in question.

Having done this in the work place the usual method is to have a stand-alone script which you run upon logging in, however, I see no reason to not have this done in the .bashrc
assuming that only one environment is available to this user, ie. should you need access to both a DEV and TEST environment, this method will only work for one.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do you use environment variables in the .bashrc file... BMan8577 Linux - Newbie 3 04-17-2011 01:16 PM
set path for different software in the bashrc file kharnab Linux - Newbie 2 08-24-2010 07:03 AM
set variables in a bash script; ansi PS1 color script donnied Programming 4 11-21-2007 11:33 AM
simple sheel script? lilili Linux - Newbie 2 02-13-2006 10:31 PM
Sheel Script kjsubbu Linux - General 5 11-25-2004 07:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration