Reputation: 18029
I want to add a function like the following to my .zshrc
:
rg() { rg "$@" --pretty less -XFRS ;}
Problem is, this causes an infinite loop upon invocation.
I thought that single-quoting the command's name ('rg' --pretty …
) bypassed locally-defined functions and aliases; but that failed to prevent the infinite-loop, for some reason.
I can implement this with an absolute path,
rg() { /usr/local/bin/rg "$@" --pretty less -XFRS ;}
… but I don't want to lose $PATH
-resolution of the program; I just want to bypass the function.
Upvotes: 2
Views: 368
Reputation: 785008
You can use command
builtin:
rg() { command rg "$@" --pretty less -XFRS ;}
This runs given COMMAND
with ARGS
suppressing shell function lookup, or display information about the specified COMMANDs.
Upvotes: 2