My problem: My web host offers ssh to their shared server. I want to set up a couple of aliases and such, so I'm trying to get a login script of any flavor to run. If my shell was plain bash, I would simply add my stuff to one of the dotfiles and be done with it.
Now, as it happens, my shell is specified as /bin/sh
, which is linked to bash:
sh-3.2$ /bin/sh --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
sh-3.2$ /bin/bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
sh-3.2$
I've tried creating all the usual suspects, ~/.bash_profile
, ~/.bash_login
, ~/.bashrc
, ~/.profile
and .login
without luck.
What can I do to execute a command on startup? Any file names I've forgotten to try? Should any of these work under my conditions? I.e. has my host done something to disable login script?
I'd prefer not asking my host to set a different shell for me until I've gotten my facts straight about this.
/bin/sh
, executes commands from~/.profile
when you log in, unless you have a shell-specific file such as~/.bash_profile
. What doesps $$ $PPID
show at this shell prompt? What aboutls -ld ~/.*profile
andecho $-
? What happens if you remove (or rename) all of the.bash*
files, and putset -x
at the top of~/.profile
?