summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTslil Clingman <hiato1@gmail.com>2014-03-04 18:27:51 +0200
committerTslil Clingman <hiato1@gmail.com>2014-03-04 18:27:51 +0200
commitb6baaa20394e4441c1abdf18a209999753e002c4 (patch)
tree83f6125658fbf375a0c9a2b097dacb58599d0eeb
parente09595fc13a59e4b84674b0875f66e6afcd801b2 (diff)
parent44365dab5497638deb7eccb4a3266e4eeafbf26a (diff)
Merge branch 'master' of github.com:tslilc/scripts
-rwxr-xr-xce10
-rwxr-xr-xvcs4
2 files changed, 7 insertions, 7 deletions
diff --git a/ce b/ce
index 982e885..49946b1 100755
--- a/ce
+++ b/ce
@@ -1,13 +1,13 @@
# Smart directory changer using the power of grep ;)
-# source in a function j() { cd `d $*`} or some such
+# source in a function j() { . ce $*} or some such
#!/bin/bash
[ "$1" = "$HOME" ] && echo $HOME && exit
fl="$HOME/.local/share/dir_lst";[ ! -f "$fl" ] && touch "$fl"
[ "$2" = "!" ] && echo "$1" && exit || \
ln=`grep -n "$1" "$fl" | head -n 1 | cut -d : -f 1`
if [ ! "$1" = "" ]; then if [ ! "$ln" = "" ]; then
-echo -e "$ln m0\n1p\nw"|ed -s "$fl"||echo \?; else
+cd `echo -e "$ln m0\n1p\nw"|ed -s "$fl"` ||echo \?; else
l=$1; while [ ! -d "$l" ]; do echo \?; read l; done;
-l=`echo "$l" | sed "s|^[^/]|$PWD/&|"`;
-echo -e "0i\n$l\n.\n1p\nw" | ed -s "$fl"; sed -i '43,$d' "$fl"
-fi; else echo -e "2 m0\n1p\nw" | ed -s "$fl"; fi;
+l=`echo "$l" | sed "s|^[^/]|$PWD/&|"`; cd $l
+echo -e "0i\n$l\n.\nw" | ed -s "$fl"; sed -i '43,$d' "$fl"
+fi; else echo -e "2 m0\nw" | ed -s "$fl"; fi;
diff --git a/vcs b/vcs
index 40b215d..d68d07c 100755
--- a/vcs
+++ b/vcs
@@ -40,8 +40,8 @@ else if [[ -d "_darcs" || -d "../_darcs" || -d "../../_darcs" ]]; then
fi;
done;
news=$(darcs what)$
- check $news "^No changes!$"
- [[ ! $? = 0 ]] && VCS_REC=$rstr
+ check $news "^No changes"
+ [[ $? = 0 ]] || VCS_REC=$rstr
fi; fi;
[[ ! "$VCS_STR" = "" ]] && echo "%F{green}$VCS_STR%f{%F{blue}$VCS_INF%f$VCS_REC$VCS_MOD$VCS_NEW}"