aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xqcd10
1 files changed, 10 insertions, 0 deletions
diff --git a/qcd b/qcd
index 698cf9f..58740ec 100755
--- a/qcd
+++ b/qcd
@@ -63,6 +63,15 @@ function remove_shortcut () {
fi
}
+function change_directory () {
+ local shortcut=$1
+
+ cd $(awk -v shortcut="$shortcut" '{
+ if ($1 == shortcut)
+ { print $2 }
+ }' $QCD_DATABASE_FILE)
+}
+
function qcd () {
if [[ $# < 1 ]]; then
print_usage
@@ -89,6 +98,7 @@ function qcd () {
print_usage
;;
*)
+ change_directory $command
;;
esac
}