Support MacOS "GNU Awk"
This commit is contained in:
parent
7ebdd0490f
commit
4943f46f75
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
|||
# goto.zsh
|
||||
|
||||
function _awk {
|
||||
which awk &>/dev/null && awk $@ || \
|
||||
which gawk &>/dev/null && gawk $@
|
||||
}
|
||||
|
||||
function _gotofile {
|
||||
echo $GOTO_FILE "$HOME/.labels.tsv" | awk "{print \$1}"
|
||||
echo $GOTO_FILE "$HOME/.labels.tsv" | _awk "{print \$1}"
|
||||
}
|
||||
|
||||
function _makeLabel {
|
||||
|
@ -35,7 +40,7 @@ function goto {
|
|||
}
|
||||
|
||||
function _goto {
|
||||
for label in $(awk '{print $1}' `_gotofile`)
|
||||
for label in $(_awk '{print $1}' `_gotofile`)
|
||||
do
|
||||
compadd "$@" $label
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue