LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-13-2009, 03:19 PM   #1
redhatwannabe
Member
 
Registered: Dec 2008
Posts: 79

Rep: Reputation: 15
why my alias is effective only after running . /home/oracle/.bash_profile


from http://ivan.kartik.sk/oracle/install...R2_redhat.html

"
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias adrci='rlwrap rman'" >> /home/oracle/.bash_profile
"

from http://www.oracle-base.com/articles/linux/rlwrap.php

"
Run the following commands, or better still append then to the ".bash_profile" of the oracle software owner.
".

so this is what my ~/.bash_profile looks like

Code:
# .bash_profile
umask 022
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
ORACLE_BASE=/u01/app/oracle/;
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;
ORACLE_SID=tomkyte;
LD_LIBRARY_PATH=$ORACLE_HOME/lib;
PATH=$PATH:$ORACLE_HOME/bin;

alias rlsqlplus='rlwrap -i sqlplus'
alias rlrman='rlwrap -i rman'

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
after login in as oracle when I run
Code:
rlrman / target
bash: rlrman: command not found
it is only after running
Code:
 . /home/oracle/.bash_profile
that I was able to rlrman

what should I do so that I need not run . /home/oracle/.bash_profile in order to run either rlsqlplus or rlrman?

Am I missing something? my distro is Centos 5.3

thanks a lot!
 
Old 05-13-2009, 03:25 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
~/.bash_profile is sourced each time that you open a new interactive-login shell. So, it will not be sourced if you login using a display manager like xdm, kde or gdm and then you one a terminal emulator. For such cases, you must use ~/.bashrc instead.

More info in the "INVOCATION" section of the bash man page.

I guess that could be the problem.
 
Old 05-14-2009, 01:34 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,893

Rep: Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613
A bit odd. I've got CENTOS 5.3 as well, and the default is to source .bashrc from .bash_profile anyway
Code:
cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
If your default shell is bash in /etc/passwd, it should run both files at login.
Maybe you didn't logout all the way after doing the changes.
It only sets them once at GUI login, then clones that for xterms.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash_profile file doesn't run in home directory spaceman spiff Slackware - Installation 3 01-13-2009 11:59 PM
need to change oracle .bash_profile from root user ? shipon_97 Linux - Enterprise 1 08-09-2007 01:27 PM
/etc/profile VERSUS /home/.bash_profile carbono Linux - Newbie 12 10-12-2005 09:23 AM
alias does not work until ". .bash_profile" pcoveney100 Linux - Software 4 06-04-2004 09:17 PM
.bash_profile alias doesn´t seem to work Electronkz Linux - Newbie 2 04-11-2004 03:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:19 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