Hacker News new | ask | show | jobs
by figmert 63 days ago
Create a wrapping binary instead

    mkdir -p ~/.local/bin
    printf '#!/usr/bin/env sh\nexec android-cli --no-metrics "$@"' > ~/.local/bin/android-cli
    echo 'PATH="$HOME/.local/bin:$PATH"' >> ~/.zshenv
1 comments

I'm pretty sure this will just call itself in a loop. You need to use the absolute path to the wrapped binary to distinguish it from the wrapper.
Also it's not a binary :-)
Aah! Yes absolutely right! Using `exec command android-cli` would work I believe
Nope. I have this alias (a default on my distribution) and it's no loop:

    alias ls='ls --color=auto'
Creating an alias is not the same as putting an executable in your $PATH.
That's true. So an alias won't do it if you use that tool from a script or something.