Newsgroups: comp.parallel.mpi
From: rdaoud@magnus.acs.ohio-state.edu (Raja B Daoud)
Subject: How to setup .profile (Was: Problems with LAM)
Organization: Ohio Supercomputer Center
Date: 20 May 1995 17:43:49 GMT
Message-ID: <3pl9ol$k54@charm.magnus.acs.ohio-state.edu>

Martin Rysanek  <rysanek@dcse.fee.vutbr.cz> wrote:
>The guys of Lam assume that your .profile simply defines PATH for
>your executable files and LAM Shell variables. They execute .profile
>during remote shell command. I had almost the same problem, so I changed
>inetexec.c file and now, it works fine.

No need to hack the source code or create another dot-file.  All that
is needed is to structure .profile to handle both interactive and
non-interactive sessions.  Example:

# Put here shared (non-interactive) code such as setting PATH
# and other variables (i.e. no tty stuff).


# Exit if not an interactive session.
tty -s
if [ $? -ne 0 ]; then return
fi

# Put here purely interactive code (e.g. stty).


If you use csh, the same strategy needs to be followed in .cshrc using
an equivalent "if-not-interactive-then-exit" test:

if (($?USER == 0) || ($?prompt == 0)) exit

--Raja

-=-
Raja Daoud				raja@tbag.osc.edu
Ohio Supercomputer Center		http://www.osc.edu/lam.html

