#!/bin/bash FOLDER='gas_mix1.0.0' ARCHIVE='gas_mix1.0.0.tgz' LOCAL=$('pwd') minimum_version=2 # Since Chet Ramey is constantly adding features to Bash, # you may set $minimum_version to 2.XX, 3.XX, or whatever is appropriate. E_BAD_VERSION=80 if [ "$BASH_VERSION" \< "$minimum_version" ] then echo "This script works only with Bash, version $minimum or greater." echo "Upgrade strongly recommended." exit $E_BAD_VERSION fi if [ -e $FOLDER ] then echo "Directory already exists:" echo $FOLDER echo "Please erase it and try again" exit 0 else if [ ! -f $ARCHIVE ] then echo "$ARCHIVE does not exists in the current directory" echo "installation failed" exit 0 else echo "+ Uncompressing file $ARCHIVE..." tar -zxvf ${ARCHIVE} > /dev/null echo "...done" echo "The archive was extracted in: ./"$FOLDER echo "" echo "+ Compiling program make_composition.exe" cd $FOLDER/data ./f0 if [ ! -f make_composition.exe ] then echo 'Error: make_composition.exe could not be compiled' else echo "" echo "+ Running program make_composition.exe" ./make_composition.exe fi cd $LOCAL rm -f ${ARCHIVE} rm -f install_gas_mix*.bash fi fi echo "" echo "Use documentation file ./$FOLDER/Doc/manual.pdf if needed" echo "Do not forget to create a link to reference spectra folder" exit 0