diff --git a/z.sh b/z.sh index 8e66074..fec8d1c 100644 --- a/z.sh +++ b/z.sh @@ -70,7 +70,7 @@ _z() { # maintain the data file local tempfile="$datafile.$RANDOM" local score=${_Z_MAX_SCORE:-9000} - _z_dirs | awk -v path="$*" -v now="$(\date +%s)" -v score=$score -F"|" ' + _z_dirs | \awk -v path="$*" -v now="$(\date +%s)" -v score=$score -F"|" ' BEGIN { rank[path] = 1 time[path] = now @@ -103,7 +103,7 @@ _z() { # tab completion elif [ "$1" = "--complete" -a -s "$datafile" ]; then - _z_dirs | awk -v q="$2" -F"|" ' + _z_dirs | \awk -v q="$2" -F"|" ' BEGIN { q = substr(q, 3) if( q == tolower(q) ) imatch = 1 @@ -128,7 +128,7 @@ _z() { l) list=1;; r) typ="rank";; t) typ="recent";; - x) sed -i -e "\:^${PWD}|.*:d" "$datafile";; + x) \sed -i -e "\:^${PWD}|.*:d" "$datafile";; esac; opt=${opt:1}; done;; *) fnd="$fnd${fnd:+ }$1";; esac; last=$1; [ "$#" -gt 0 ] && shift; done @@ -144,7 +144,7 @@ _z() { [ -f "$datafile" ] || return local cd - cd="$( < <( _z_dirs ) awk -v t="$(\date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" ' + cd="$( < <( _z_dirs ) \awk -v t="$(\date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" ' function frecent(rank, time) { # relate frequency and time dx = t - time