Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`alias android-cli='android-cli --no-metrics'`
 help



Uh do aliases load in non-interactive shells?

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

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.

Aah! Yes absolutely right! Using `exec command android-cli` would work I believe

Also it's not a binary :-)

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.

You could export BASH_ENV to have Bash processes source a given file at startup.

Zsh has .zshenv, and Fish just has config.fish for everything with the ability to guard certain things within it to login only or non-interactive only.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: