bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Install Bashdb and Bash not as root


From: Bob Proulx
Subject: Re: Install Bashdb and Bash not as root
Date: Thu, 5 Mar 2009 10:17:50 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

lehe wrote:
> As to changing to new bash from the beginning, I added into .bash_profile:
> "SHELL='/cis/home/tingli/bin/bash-3.2.48/bin/bin/bash'
> exec $SHELL "
> It works quite well. The new bash starts automatically if I ssh to the
> server from my laptop.

Good.  Is there really two "/bin/bin/"s adjacent there?

> However, if I login using my office computer, which loads my HOME on server
> directly as its hard disk, 
> I will get such error:
> "Your session only lasted less than 10 seconds. ...
> If I comment the lines added to .bash_profile, I would be able to login
> successfully.

It does this because the path you supplied in your .bash_profile for
SHELL doesn't exist on that host.  Right?  On one host your home is in
one path and in another it is a different path?

> Looks like I can get only one work, either my office computer or my laptop. 

Or you need to have your .bash_profile select the appropriate path for
SHELL.  If your home is the only difference then you should use $HOME
to dynamically select the right path to your home directory.

  SHELL="$HOME/bin/bash-3.2.48/bin/bin/bash"
  exec "$SHELL"

Adding a check for that shell existing would probably be wise.

  SHELL="$HOME/bin/bash-3.2.48/bin/bin/bash"
  if [ -x "$SHELL" ]; then
    exec "$SHELL"
  fi
  echo "Unable to exec my custom shell."

Or if your $HOME isn't sufficient then you would need to write it out
in long form.

  SHELL="/first/path/to/check/for/bash-3.2.48/bin/bash"
  if [ -x "$SHELL" ]; then
    exec "$SHELL"
  else
    SHELL="/some/other/path/to/bash-3.2.48/bin/bash"
    if [ -x "$SHELL" ]; then
      exec "$SHELL"
    fi
  fi
  echo "Unable to exec my custom shell."

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]