Last active
December 20, 2015 23:28
-
-
Save stowler/6212443 to your computer and use it in GitHub Desktop.
afniSwitchFromRepo.sh - temporarily switch from the neurodebian repo version of AFNI to a local alternative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# afniSwitchFromRepo.sh | |
# | |
# A script to tempoarily switch the user from the neurodebian repo version of | |
# AFNI to a local alternative install (e.g., /opt/abin). Works in combination | |
# with afniSwitchToRepo.sh | |
# Specify the parent directory of alternative AFNI's binaries: | |
# e.g., afniAlternativePath=/opt/abin | |
afniAlternativePath=/opt/abin | |
# Clear any AFNI environmental variables: | |
unset `env | awk -F= '/AFNI/ {print $1}' | xargs` | |
# Backup the user's current $PATH to an environmental variable so we can switch back | |
# to it later: | |
export afniRepoVersionOfPATH=${PATH} | |
# Prepend the path of the alternative (non-repo) version of afni to the user's $PATH: | |
export PATH=${afniAlternativePath}:${PATH} | |
# Print afni version info to the terminal: | |
echo "" | |
echo "Switching to the non-repo version of AFNI:" | |
echo "" | |
echo "----------- active afni version and variables: -----------" | |
afni -ver | |
echo -n "The command 'afni' will launch: " | |
which afni | |
echo -n "The command '3dinfo' will launch: " | |
which 3dinfo | |
echo "AFNI environmental variables, if any exist:" | |
env | grep AFNI | |
echo "----------------------------------------------------------" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment