I tried making a custom command for my terminal. I'm running Mac OS X Version 10.6.6.
Here are the steps I took:
Opened the terminal
Typed "ls -a" and saw a ".bash_profile" file
Typed "vi .bash_profile" and saw that the file was empty
Added the following to the top of the file: "test() { echo hi }"
Saved the vi session by typing ":wq"
Then, I was back to the terminal, and typed "test", however nothing outputted (namely, I didn't see "hi").
So, what am I doing wrong? Thanks!
In the Terminal app on your Mac, invoke a command-line editor by typing the name of the editor, followed by a space and then the name of the file you want to open. If you want to create a new file, type the editor name, followed by a space and the pathname of the file.
try to force re-evaluation of file by typing source .bash_profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With