Skip to content

Instantly share code, notes, and snippets.

@opragel
Last active April 6, 2016 22:56
Show Gist options
  • Save opragel/8875401b5ae61ab263107e485e3fe896 to your computer and use it in GitHub Desktop.
Save opragel/8875401b5ae61ab263107e485e3fe896 to your computer and use it in GitHub Desktop.
spss_is_bad_but_so_is_this.sh
#!/bin/bash
SPSS_STATISTICS_PATH="/Applications/IBM/SPSS/Statistics/"
SPSS_DAEMONHOST="mycooldaemonhost"
if [ -d "$SPSS_STATISTICS_PATH" ]; then
spssVersion=$(ls "$SPSS_STATISTICS_PATH" | tail -n 1)
spssInfPath='/Applications/IBM/SPSS/Statistics/'"$spssVersion"'/Contents/bin/spssprod.inf'
if [ -f "$spssInfPath" ]; then
sed -i.bak "s/DaemonHost=.*/DaemonHost=$SPSS_DAEMONHOST/" "$spssInfPath"
else
printf "can't find SPSS INF at %s :(" "$spssInfPath"
fi
else
printf "can't find SPSS statistics folder at %s :(" "$SPSS_STATISTICS_PATH"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment