Arvswitch » History » Revision 3
Revision 2 (Peter Amstutz, 11/11/2015 04:11 PM) → Revision 3/10 (Peter Amstutz, 11/11/2015 04:12 PM)
h1. Arvswitch Copy this into your @.bashrc@ or create a new file called something like "arvswitch.sh" and add the line ". arvswitch.sh" to your @.bashrc@ <pre> HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*' arvswitch() { if [[ -n "$1" ]] ; then if [[ -f $HOME/.config/arvados/$1.conf ]] ; then unset ARVADOS_API_HOST_INSECURE for a in $(cat $HOME/.config/arvados/$1.conf) ; do export $a ; done else echo "$1 unknown" fi else echo "Switch Arvados environment conf" echo "Usage: arvswitch name" fi } arvlist() { (cd $HOME/.config/arvados && ls --indicator-style=none *.conf) | rev | cut -c6- | rev } arvsave() { if [[ -n "$1" ]] ; then unset ARVADOS_API_HOST_INSECURE env | grep ARVADOS_ > $HOME/.config/arvados/$1.conf else echo "Save current Arvados environment variables to conf file" echo "Usage: arvsave name" fi } arvrm() { if [[ -n "$1" ]] ; then if [[ -f $HOME/.config/arvados/$1.conf ]] ; then rm $HOME/.config/arvados/$1.conf else echo "$1 unknown" fi else echo "Delete Arvados environment conf" echo "Usage: arvrm name" fi } </pre>