mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 10:05:57 +01:00
Error in bash script
This commit is contained in:
parent
13ce974ee4
commit
8731ba6748
@ -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"
|
||||
|
@ -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}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user