Skip to content

Instantly share code, notes, and snippets.

@shichao-an
Last active December 21, 2015 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shichao-an/bdeb1081d78b990169c7 to your computer and use it in GitHub Desktop.
Save shichao-an/bdeb1081d78b990169c7 to your computer and use it in GitHub Desktop.
~/.sshrc for Ubuntu and Debian
# If .profile already exists, execute it.
if [ -f "$HOME/.profile" ]; then
. "$HOME/.profile"
else
# Otherwise, copy .profle from /etc/skel
if [ -f "/etc/skel/.profile" ]; then
cp /etc/skel/.profile "$HOME"
fi
# Also check if .bashrc exists and otherwise copy it from /etc/skel
if [ ! -f "$HOME/.bashrc" ]; then
if [ -f "/etc/skel/.bashrc" ]; then
cp /etc/skel/.bashrc "$HOME"
fi
fi
# If .profile exists, run it, which will in turn run .bashrc
if [ -f "$HOME/.profile" ]; then
. "$HOME/.profile"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment