projects
/
grml-etc-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf69b33
)
zshrc: Make `cd()\ behave with more than one argument
author
Frank Terbeck
<ft@grml.org>
Thu, 18 Aug 2011 16:36:32 +0000
(18:36 +0200)
committer
Frank Terbeck
<ft@grml.org>
Thu, 18 Aug 2011 16:36:32 +0000
(18:36 +0200)
etc/zsh/zshrc
patch
|
blob
|
history
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
a34b170
..
5d908f0
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-2786,12
+2786,12
@@
fir() {
}
# smart cd function, allows switching to /etc when running 'cd /etc/fstab'
cd() {
- if [[ -f ${1} ]]; then
+ if
(( ${#argv} == 1 )) &&
[[ -f ${1} ]]; then
[[ ! -e ${1:h} ]] && return 1
print "Correcting ${1} to ${1:h}"
builtin cd ${1:h}
else
- builtin cd
${1}
+ builtin cd
"$@"
fi
}