1968
1968
read -p "Add a Galacticus environment alias to .bashrc? [no/yes]: " RESPONSE
1969
1969
if [ "$RESPONSE" = yes ] ; then
1970
1970
if [ -e $HOME/.bashrc ]; then
1971
awk 'BEGIN {inGLC=0} {if (index($0,"Alias to configure the environment to compile and run Galacticus v0.9.1") > 0) inGLC=1;if (inGLC == 0) print $0; if (inGLC == 1 && index($0,"export GALACTICUS_FLAGS")) inGLC=0}' $HOME/.bashrc > $HOME/.bashrc.tmp
1971
awk 'BEGIN {inGLC=0} {if (index($0,"Alias to configure the environment to compile and run Galacticus v0.9.1") > 0) inGLC=1;if (inGLC == 0) print $0; if (inGLC == 1 && index($0,"'"'"'")) inGLC=0}' $HOME/.bashrc > $HOME/.bashrc.tmp
1972
1972
mv -f $HOME/.bashrc.tmp $HOME/.bashrc
1974
1974
echo "# Alias to configure the environment to compile and run Galacticus v0.9.1" >> $HOME/.bashrc