Create Script Alias
- Open your shell configuration file:
nano ~/.bashrc - Scroll the the bottom, and add an alias line:
alias aliasName= path-to-script.sh - E.g.
alias beans='~/Desktop/XT7_RT/scripts/beans.sh' Ctrl+O,Enter, &CTRL+Xto save and exit.- Reload the shell config:
source ~/.bashrc - To run, simply type the name of the alias.
The script:¶
#!/bin/bash
cd /home/ajrob/Desktop/XT7_RT/build
cmake ..
make
sudo ./main
# Make it executable
# chmod +x ~/Desktop/XT7_RT/scripts/beans.sh
# Then make it a global alias. We are going to add it in ~/.bashrc
# nano ~/.bashrc
# We go to the bottoma and add the following line
# alias beans='~/Desktop/XT7_RT/scripts/beans.sh
# Save and refresh with:
# source ~/.bashrc