2

I have two PuTTy sessions open to the same host. One one cd ~ gets me back to my home dir fine and on another one it doesn't -- stays in the same dir.

I have never seen something like this happen.

Any idea why this might be happening?

OS: SunOS 5.10

amphibient
  • 12,472
  • 18
  • 64
  • 88

1 Answers1

2

It sounds like you've changed or unset your $HOME environment variable in one of the ssh sessions.

$HOME is the default arg for the cd built-in, at least for all the sh-like shells that I have installed on my system (incl. dash, bash, ksh, and zsh).

They all have something like this in their man page (from dash):

 HOME   The home directory of the current user; the default argument for
        the cd builtin command.  The value of this variable is also used
        when performing tilde expansion.
cas
  • 78,579