From 527c684118b24f87427cc124d6add22a5cc68352 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 4 Jan 2019 20:01:27 -0600 Subject: [PATCH] Initial Checkin --- .bash_aliases | 4 ++++ qcd.sh | 2 ++ qg.sh | 10 ++++++++++ ql.sh | 4 ++++ qs.sh | 6 ++++++ 5 files changed, 26 insertions(+) create mode 100644 .bash_aliases create mode 100644 qcd.sh create mode 100644 qg.sh create mode 100644 ql.sh create mode 100644 qs.sh diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..066aca5 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,4 @@ +alias qs=qs.sh +alias ql=ql.sh +alias qg=qg.sh +alias qcd=". qcd.sh" diff --git a/qcd.sh b/qcd.sh new file mode 100644 index 0000000..4e227fb --- /dev/null +++ b/qcd.sh @@ -0,0 +1,2 @@ +path=$(qg.sh $*) +cd "$path" diff --git a/qg.sh b/qg.sh new file mode 100644 index 0000000..6258fce --- /dev/null +++ b/qg.sh @@ -0,0 +1,10 @@ +echoerr() { + echo "$@" 1>&2; +} + +theLine=$(IFS='\t' grep "^${*} " < ~/.qcdrc) +read -r quick path <<< "$theLine" +if [[ -z $theLine ]] +then echoerr Not found: $* +else echo $path +fi diff --git a/ql.sh b/ql.sh new file mode 100644 index 0000000..f9404dc --- /dev/null +++ b/ql.sh @@ -0,0 +1,4 @@ +grep "${*}" ~/.qcdrc | while read theLine +do +echo -e ${theLine/ / -> } +done diff --git a/qs.sh b/qs.sh new file mode 100644 index 0000000..3d6a8a6 --- /dev/null +++ b/qs.sh @@ -0,0 +1,6 @@ +if [[ -z ${*} ]] +then echo you have to supply a quick name. +else grep -v "^${*} " ~/.qcdrc > /tmp/qcd.$$ + mv /tmp/qcd.$$ ~/.qcdrc + echo -e "${*}\\t${PWD}" >> ~/.qcdrc; +fi