Skip to content

Instantly share code, notes, and snippets.

@mv
Last active August 29, 2015 14:02
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 mv/3830c869494a718c0786 to your computer and use it in GitHub Desktop.
Save mv/3830c869494a718c0786 to your computer and use it in GitHub Desktop.
cat > /etc/bashrc <<'EOF'
# /etc/bashrc
# System wide functions and aliases
# (environment variables goes in /etc/profile)
##
## ferreira.mv@gmail.com:
##
## /etc/bashrc does the following:
## - bash shopt's for interactive shells
## - Enforce itens from /etc/profile.d for non-login shells
##
# troubleshooting aide:
[ -f /etc/.env-verbose ] && echo "# Inside /etc/bashrc: [$0]"
[ -f /etc/.env-debug ] && set -x
# This is an interactive shell
if [ "$PS1" ]
then
# Turn on parallel history
shopt -s histappend
history -a
# Turn on checkwinsize
shopt -s checkwinsize
fi
# If this is not a login shell
if ! shopt -q login_shell
then
# Enforce environment itens: for successive non-login shells
umask 002
for f in /etc/profile.d/*.sh
do
if [ -r "$f" ]
then
[ -f /etc/.env-verbose ] && echo "# /etc/bashrc: calling [$f]"
. "$f" >/dev/null
else
[ -f /etc/.env-verbose ] && echo "# /etc/bashrc: ignoring [$f]"
fi
done
unset f
fi
# vim:ts=4:sw=4:ft=sh:
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment