Re: [Hampshire] irritating ssh behaviour

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] irritating ssh behaviour
Yep, just so. Path not initialised, profile not executed ...

victor@ss07:~$ ssh qq3 '/u01/app/oracle/OraHome_1/bin/oerr ORA 12152'
ORACLE_HOME not set. Please set ORACLE_HOME and try again.

Basically I think we are in an analogous situation to when you set up
a cron job to run: you get a minimal environment and that is it.

So doing everything explicitly does the job:

victor@ss07:~$ ssh qq3 '. .bash_profile ; oerr ORA 12152'
12152, 00000, "TNS:unable to send break message"
// *Cause: Unable to send break message. Connection probably disconnected.
// *Action: Reestablish connection. If the error is persistent, turn
// on tracing and reexecute the operation.

Trouble is it kind of nullifies the aim of the exercise which was to
have a quick (ish) invocation [type "ssh qq3 oerr ", copy-paste in a
number, hit Enter).

Aliases to the rescue!!

victor@ss07:~$ alias oerr="ssh qq3 '. .bash_profile ; oerr ORA $@'"
victor@ss07:~$ oerr 12152
12152, 00000, "TNS:unable to send break message"
// *Cause: Unable to send break message. Connection probably disconnected.
// *Action: Reestablish connection. If the error is persistent, turn
// on tracing and reexecute the operation.
victor@ss07:~$

Ta bloomin' raa. Thanks for the contributions. Now better get back to work!