#!/bin/bash
function test_and_source() {
filepath=$1
if [[ -f $filepath ]]; then
source $filepath
return 0
fi
return 1
}
$(test_and_source "/usr/bin/virtualenvwrapper.sh")
if [ $? -eq 0 ]; then
echo 'source success'
else
echo 'source fails'