2008/8/23 Joel Rees <[EMAIL PROTECTED]>:
> On 平成 20/08/22, at 19:21, Philip Guenther wrote:
>> 2008/8/21 Joel Rees <[EMAIL PROTECTED]>:
...
> When I start csh at the command line in xterm, csh sources .cshrc like I
> expect. (That is, the flag shows up in the environment.)
>
> But neither sh nor ksh source .profile when I run them from the command
> line.
Right, because they only source .profile when run as login shells.
However, if you set the ENV environment variable to the path of a file
to parse before you invoked sh or ksh, then they would parse that
file. I.e.:
$ cat >/home/users/guenther/.env
echo foo
PS1='inner$ '
$ env ENV=$HOME/.env ksh
foo
inner$ exit
$
...
> xdm. That is, I cleared the flag that prevents xdm running in
> /etc/rc.conf.local. (Not booted up in openbsd right now, but I think maybe
> you'll recognize that?)
Gotcha. In that case my recommendation is:
1) have xterm start login shells by putting this line in $HOME/.Xresources
XTerm*loginShell: true
and, if you have a $HOME.xsession file, then make sure it has a
line like this:
test -r $HOME/.Xresources && xrdb -load $HOME/.Xresources
near its top.
2) put all your .profile file the following types of stuff:
- setting and exporting of environment variables (including CVSROOT)
- umask
- export ENV=$HOME/.kshrc (or whatever file you prefer)
3) put in your $ENV file the following types of stuff:
- shell functions
- shell settings that aren't environment variables, such as MAILCHECK,
"set -o emacs", 'bind'
- stuff that requires a terminal (stty, tset), but wrapped in a
test like this:
if [ -t 0 ]; then
stty blah blah
fi"
so that it doesn't run if you don't actually have a terminal
Hopefully that'll give you a place to start from when you have a
chance to take another stab at this.
Philip Guenther