overview
To distinguish it from your usual environment, define aliases for the commands used in MacPorts.
procedure
- Creating an Alias File
- Check if it was created
- Importing an Alias File
- Check if the setting was successful
1. Creating an alias file
Create the following folder and alias file in your home folder, and append the string you want to set to the alias file.
Click to copy each line, paste it into Terminal, and press Enter.
2. Check if it was created
Verify that the bashrc_folder folder exists in your home folder and that the string you echoed is displayed in the macports_alias file.
Click and copy each line, paste it into Terminal, and press Enter.
3. Importing an Alias File
Open Terminal and set up the alias with the following command:
Click the command to copy it, paste it into Terminal, and press Enter.
4. Check if the setting was successful
Run the hello_macports_alias command and if it displays hello_macports_alias, it’s OK.
Points to note
Please note that the alias file will be cleared when you close the terminal, so you will need to reload the alias file the next time you open the terminal.