Have an experienced user look at your shell's
setup files (2.2
There could be some obvious mistakes that you didn't catch.
Log in to another account and use the
the stuck account uses Bourne-type shells) or the
su -f stucklogin
command (if the stuck account uses csh
) to the home directory.
Rename the account's setup files
so the shell won't see them as you
If you can log in after that, you know that the problem is with the
account's setup files.
Set shell debugging (8.17
From another account or as the superuser, start an editor and put
the following line at the top of an sh
-like setup file (like
It'll tell you whether
is being read at all and where it hangs:
You'll see each line read from the .profile
and the commands executed
on the screen. If you don't see anything, then the shell probably didn't
read the .profile
C shell users should put this command at the top of .cshrc
set echo verbose
Note that on many UNIX systems, the shell won't read its startup files
if the files aren't owned by you.
You might use
Look at the entry in the
for this user.
Be sure it has the correct number of fields (separated by
Also, see if there's another user with the same login name.
(If your system has the commands vipw
(8) and pwck
your system administrator should be using them to edit and check the
They avoid many of these problems.)
Does your account use any
directories remotely mounted (by NFS) (1.33
If the remote host or network is down, and any command in your startup
files (especially set path
) tries to access those
directories, the shell may hang there.
To fix that problem, su
to the account as explained above and take the
command or directory name out of your startup file.
Or, if this problem happens a lot, the system administrator can mount an
NFS filesystem "soft" (instead of the default, "hard") and limit the number
What looks like a "hang" might also be that you just aren't getting any output
to the terminal, for some very weird reason.
Then the set -xv
wouldn't help you.
In that case, try adding this line to the start of the .profile
exec > /tmp/sh.out.$$ 2>&1
If the Bourne shell starts reading the .profile
, it'll make a file in
with output from the commands and the
shell's set -xv
There's no command like that for the C shell.