bashrc and .profile for password-less ssh
Marius Gedminas
marius at pov.lt
Thu Sep 2 16:32:13 UTC 2010
On Thu, Sep 02, 2010 at 10:41:55AM -0500, shantanu pavgi wrote:
> I am having some issue in executing in setting values in .bashrc file on ssh
> based command execution. If I log in using SSH then bashrc is sourced and
> settings in it work. But following doesn't work and returns no value:
> {{{
> inode:~ shantanu$ ssh 192.168.174.129 "echo $CATALINA_HOME"
> }}}
Interactive shells are different:
* they don't read .profile
* they read .bashrc, but your bashrc returns early:
> ****** And here is .bashrc file:
>
> {{{
> shantanu at ubox:~$ cat .bashrc
> # ~/.bashrc: executed by bash(1) for non-login shells.
> # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
> # for examples
>
> # If not running interactively, don't do anything
> [ -z "$PS1" ] && return
There.
Move your variable definition above that line and it will be used both
for interactive and non-interactive shell sessions.
Marius Gedminas
--
Cool. Does it also recode ISO10646-1 pcf files into the funny
permutations and subsets used a long time ago in a galaxy far far away
on the planets Isolatinus XV and Koiruski VIII ...
-- Markus Kuhn inquires about libXft
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100902/26e06c9a/attachment.sig>
More information about the ubuntu-users
mailing list