aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-08-31 12:42:33 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-08-31 12:42:33 -0300
commitecfa87f82f2a9fbc40f84d64cb8fda4038eced48 (patch)
tree6f19429e7b7bf5248eef0719f4df29f630fa7854
parent66e883dd20b7076b5472708e829183b465ac8ffd (diff)
downloadprofile-ecfa87f82f2a9fbc40f84d64cb8fda4038eced48.tar.gz
profile-ecfa87f82f2a9fbc40f84d64cb8fda4038eced48.tar.bz2
Move cd function into .profile
-rw-r--r--bashrc.dot.link13
-rw-r--r--profile.dot.link13
2 files changed, 14 insertions, 12 deletions
diff --git a/bashrc.dot.link b/bashrc.dot.link
index ed3e361..ab85f71 100644
--- a/bashrc.dot.link
+++ b/bashrc.dot.link
@@ -1,17 +1,6 @@
#
-# Bash rc file
+# Bash initialization
#
-# See http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd
-function cd {
- if [ -z "$*" ]; then
- destination=~
- else
- destination=$*
- fi
-
- builtin cd "${destination}" > /dev/null
-}
-
# Load the profile
. $HOME/.profile
diff --git a/profile.dot.link b/profile.dot.link
index ef4c187..4beea3c 100644
--- a/profile.dot.link
+++ b/profile.dot.link
@@ -31,6 +31,19 @@ export PATH=$PATH
# See http://www.caliban.org/bash/#bashtips
export CDPATH=".:~:~/code:~/data:~/file:~/apps:/var/www/data"
+# See http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd
+if [ ! -z "$BASH" ]; then
+ function cd {
+ if [ -z "$*" ]; then
+ destination=~
+ else
+ destination=$*
+ fi
+
+ builtin cd "${destination}" > /dev/null
+ }
+fi
+
# Editor variables, avoiding "Avoiding protocol specified" error
export EDITOR="vim -X"