4 ms·
The first way that comes to mind is to use alias, e.g. `alias ipaddress="ipconfig getifaddr en0"`. Then running `ipaddress` would do what you want. To avoid hav
by molloy 10y ago
The first way that comes to mind is to use alias, e.g. `alias ipaddress="ipconfig getifaddr en0"`. Then running `ipaddress` would do what you want. To avoid having to run this again every time you log in, you can add the same line to your `~/.bash_profile`, which configures your shell when you log in before the initial command prompt. You can then type `source ~/.bash_profile` to reload your configuration without having to log out then back in.
- sethrin 10y agoor just box$ . ~/.bash_profile But I prefer zsh/prezto. I spend far too much time on the command line, so I want it to look pretty and tab-complete all the things.
- Entangled 10y agoOk, so I write a bash script then create an alias for it like alias hello="bash hello.sh" Something like that? I found some nice bash tutorials that'll keep me busy for the weekend. Thanks. Edit: Ok, apparently alias hello is not needed since hello.sh can be run directly with just the name, I was having permission problems and couldn't make it run, but now with just $ hello I can see the output. I'm loving it!