jbanana: Badly drawn banana (Default)
J Banana ([personal profile] jbanana) wrote2021-09-22 09:10 pm
Entry tags:

Setting an alias with BusyBox ash

I installed a VM with Alpine Linux. It uses BusyBox, including for the default shell, ash. How do I set an alias?

I tried startup scripts of various names. No joy. They were ignored. The internet suggested that if I put the name of the script in an environment variable called ENV, the named script would be run at shell startup. But where do I set *that*?

After poking around, all scripts in /etc/profile.d get run, so I added /etc/profile.d/setashrc.sh which just contains
export ENV=$HOME/.ashrc

Now I can set an alias in ~/.ashrc but I'm wondering why there isn't some sort of default?

Anyway, this post is mostly in case I ever need to do this again.