10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-22 05:02:15 +02:00

Error in bash script

This commit is contained in:
Anthony Scemama 2015-09-22 09:07:34 +02:00
parent 13ce974ee4
commit 8731ba6748
2 changed files with 17 additions and 11 deletions

View File

@ -8,6 +8,8 @@
# Prints in stdout the name of a temporary file containing the basis set.
#
if [[ -z ${QP_ROOT} ]]
then
print "The QP_ROOT environment variable is not set."
@ -15,6 +17,7 @@ then
exit -1
fi
export EMSL_API_ROOT="${QP_ROOT}"/install/emsl
tmpfile="$1"

View File

@ -4,6 +4,9 @@
# directory, where xxx is the corresponding mo_label.
# Wed Apr 2 14:35:15 CEST 2014
set -u # Crashes if a variable is uninitialized
set -e # Exits if any statement returns a non-true return value
if [[ -z ${QP_ROOT} ]]
then
print "The QP_ROOT environment variable is not set."
@ -11,40 +14,40 @@ then
exit -1
fi
EZFIO=$1
EZFIO="$1"
if [[ -z ${EZFIO} ]]
if [[ -z "${EZFIO}" ]]
then
echo "Error in $0"
exit 1
fi
if [[ ! -f ${EZFIO}/mo_basis/mo_label ]]
if [[ ! -f "${EZFIO}/mo_basis/mo_label" ]]
then
LABEL='no_label'
else
LABEL=$(head -1 ${EZFIO}/mo_basis/mo_label)
LABEL=$(head -1 "${EZFIO}/mo_basis/mo_label")
fi
DESTINATION="save/mo_basis/${LABEL}"
cd ${EZFIO}
cd "${EZFIO}"
if [[ ! -d save/mo_basis ]]
then
mkdir -p save/mo_basis
fi
BACKUP=${DESTINATION}.old
if [[ -d ${BACKUP} ]]
BACKUP="${DESTINATION}.old"
if [[ -d "${BACKUP}" ]]
then
rm -rf ${BACKUP}
rm -rf "${BACKUP}"
fi
if [[ -d ${DESTINATION} ]]
if [[ -d "${DESTINATION}" ]]
then
mv ${DESTINATION} ${BACKUP}
mv "${DESTINATION}" "${BACKUP}"
fi
cp -r mo_basis ${DESTINATION}
cp -r mo_basis "${DESTINATION}"