Commit 141c9543 authored by jie's avatar jie

added necessary ENVs to bashrc

parent bb184663
function env_set() {
sed -i -e "/^export $2=.*/d" ~/.bashrc
echo "export $2=`readlink -e $1`" >> ~/.bashrc
}
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
......@@ -25,5 +29,10 @@ git checkout hustpa/pa4
git checkout -b pa4 hustpa/pa4
git checkout hustpa/pa5
git checkout -b pa5 hustpa/pa5
echo "set ENV ..."
env_set nemu NEMU_HOME
env_set nexus-am AM_HOME
env_set navy-apps NAVY_HOME
source ~/.bashrc
echo "done!"
function env_set() {
sed -i -e "/^export $2=.*/d" ~/.bashrc
echo "export $2=`readlink -e $1`" >> ~/.bashrc
}
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
......@@ -24,5 +28,9 @@ git branch -u hustpa/pa2 pa2
git branch -u hustpa/pa3 pa3
git branch -u hustpa/pa4 pa4
git branch -u hustpa/pa5 pa5
echo "set ENV ..."
env_set nemu NEMU_HOME
env_set nexus-am AM_HOME
env_set navy-apps NAVY_HOME
source ~/.bashrc
echo "done!"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment