Browse Source

chore(First commit): Clean up rc files

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 năm trước cách đây
mục cha
commit
44a859a018
4 tập tin đã thay đổi với 33 bổ sung23 xóa
  1. 15 5
      bash_profile
  2. 8 8
      bashrc
  3. 3 3
      zlogin
  4. 7 7
      zshrc

+ 15 - 5
bash_profile

@@ -1,10 +1,20 @@
-if [ -f $HOME/.bashrc ]; then
-  source $HOME/.bashrc
+# ~/.profile: executed by the command interpreter for login shells.
+# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
+# exists.
+# see /usr/share/doc/bash/examples/startup-files for examples.
+# the files are located in the bash-doc package.
+
+# the default umask is set in /etc/profile; for setting the umask
+# for ssh logins, install and configure the
+#umask 023
+
+if [ -f ${HOME}/.bashrc ]; then
+  source ${HOME}/.bashrc
 fi
 
 # load all files from .shell/login.d directory
-if [ -d $HOME/.shellrc/login.d ]; then
-  for file in $HOME/.shellrc/login.d/*.sh; do
-    source $file
+if [ -d ${HOME}/.shellrc/login.d ]; then
+  for file in ${HOME}/.shellrc/login.d/*.sh; do
+    source ${file}
   done
 fi

+ 8 - 8
bashrc

@@ -1,4 +1,4 @@
-# $HOME/.bashrc
+# ${HOME}/.bashrc
 #
 # this file is sourced by all *interactive* bash shells on startup,
 # including some apparently interactive shells such as scp and rcp
@@ -8,21 +8,21 @@
 # test for an interactive shell. there is no need to set anything
 # past this point for scp and rcp, and it's important to refrain from
 # outputting anything in those cases.
-if [[ $- != *i* ]] ; then
+if [[ $- != *i* ]] || [[ -z "$PS1" ]]; then
   # shell is non-interactive. be done now!
   return
 fi
 
 # load all files from .shell/bashrc.d directory
-if [ -d $HOME/.shellrc/bashrc.d ]; then
-  for file in $HOME/.shellrc/bashrc.d/*.bash; do
-    source $file
+if [ -d ${HOME}/.shellrc/bashrc.d ]; then
+  for file in ${HOME}/.shellrc/bashrc.d/*.bash; do
+    source ${file}
   done
 fi
 
 # load all files from .shell/rc.d directory
-if [ -d $HOME/.shellrc/rc.d ]; then
-  for file in $HOME/.shellrc/rc.d/*.sh; do
-    source $file
+if [ -d ${HOME}/.shellrc/rc.d ]; then
+  for file in ${HOME}/.shellrc/rc.d/*.sh; do
+    source ${file}
   done
 fi

+ 3 - 3
zlogin

@@ -1,6 +1,6 @@
 # load all files from .shell/login.d directory
-if [ -d $HOME/.shellrc/login.d ]; then
-  for file in $HOME/.shellrc/login.d/*.sh; do
-    source $file
+if [ -d ${HOME}/.shellrc/login.d ]; then
+  for file in ${HOME}/.shellrc/login.d/*.sh; do
+    source ${file}
   done
 fi

+ 7 - 7
zshrc

@@ -1,15 +1,15 @@
-# $HOME/.zshrc
+# ${HOME}/.zshrc
 
 # load all files from .shell/zshrc.d directory
-if [ -d $HOME/.shellrc/zshrc.d ]; then
-  for file in $HOME/.shellrc/zshrc.d/*.zsh; do
-    source $file
+if [ -d ${HOME}/.shellrc/zshrc.d ]; then
+  for file in ${HOME}/.shellrc/zshrc.d/*.zsh; do
+    source ${file}
   done
 fi
 
 # load all files from .shell/rc.d directory
-if [ -d $HOME/.shellrc/rc.d ]; then
-  for file in $HOME/.shellrc/rc.d/*.sh; do
-    source $file
+if [ -d ${HOME}/.shellrc/rc.d ]; then
+  for file in ${HOME}/.shellrc/rc.d/*.sh; do
+    source ${file}
   done
 fi