Skip to content

Instantly share code, notes, and snippets.

View adamnorwood's full-sized avatar
👋

Adam Norwood adamnorwood

👋
View GitHub Profile
@austinjreilly
austinjreilly / switchenv.sh
Last active August 29, 2015 13:56
Shell function that allows users of the University of Texas Web Central to quickly toggle between test and live environments.
function switchenv(){
TEST="/export/httpd/vhosts/wwwtest/data/law"
PROD="/export/bulk/law"
CURRENTDIR=$(pwd -P)
if [[ "$CURRENTDIR" == *"$TEST"* ]]
then
#In test, so remove test prefix and replace with prod prefix
NEWDIR=${CURRENTDIR/$TEST/$PROD}