Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: A bit of Linux advice yet again??

Re: A bit of Linux advice yet again??

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 3 Feb 2003 08:56:52 -0800
Message-ID: <336da121.0302030856.79d7a732@posting.google.com>


"Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote in message news:<0FK_9.38003$jM5.96462_at_newsfeeds.bigpond.com>...
> OK, maybe I should post this in a Linux newsgroup, but...
>
> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0 (which, I have
> to say, is the first Linux distro I've seen that's persuaded me there are
> viable alternatives to Windows). I have a "DB9" instance/database and an
> OEMREP instance/database. Log on as the Oracle user, and there's not a
> problem.
>
> But I want to log on as me. So, I create a .profile in my home directory
> that sets all the usual variables, including path.
>
> I reboot the machine, just because I'm a former Windows user and we're used
> to that sort of thing. I log on as me. I open a terminal window, and type
> 'sqlplus', and I get the error 'command not found'.
>
> I then type ". ./.profile", and the 'sqlplus' command works perfectly.
>
> Now, I realise I only know the backend of batch files, but I was rather
> under the impression that .profile would be invoked the moment I logged in.
> So why isn't it? What am I doing wrong (try and keep the list modestly
> short!).
>

Howard,

It's a tricky part with linux, actually, with bash. .profile is not the
primary file executed on logon. There are several files you need to check.
Here's the cut from bash manual:

 An interactive shell is one whose standard input and output are both connected to terminals (as determined by isatty(3)), or one started with the -i flag. PS1 is set and $- includes i if bash is interactive, allowing a way to test this state from a shell script or a startup file.

Login shells:

On login:

If /etc/profile exists, source it.
If ~/.bash_profile exists, source it,
else if ~/.bash_login exists, source it, else if ~/.profile exists, source it.
On logout: If ~/.bash_logout exists, source it.

Non-login interactive shells:

On startup:

If ~/.bashrc exists, source it.

Non-interactive shells:

On startup

If the environment variable ENV is non-null, expand it and source the file it names.

In short, check your .bash_login and .bash_profile files. If they exist,
check if they call .profile.

HTH
> Oh -one other thing. I know all about oratab, and I *do* get both my
> instances starting automatically at reboot. But how does one automate the
> intelligent agent and listener? oratab doesn't seem syntactically capable of
> doing these, so I guess I must look elsewhere. Am I deep into shell
> scripting at this point??
>
> Forebearance for a Windows user, please. I am at least trying!!
>
> Regards
> HJR
Received on Mon Feb 03 2003 - 10:56:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US