Last active
August 29, 2015 14:02
-
-
Save mv/3830c869494a718c0786 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/bashrc <<'EOF' | |
# /etc/bashrc | |
# System wide functions and aliases | |
# (environment variables goes in /etc/profile) | |
## | |
## [email protected]: | |
## | |
## /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