Commit 97aa152c authored by Lucas Mello Schnorr's avatar Lucas Mello Schnorr
Browse files

use an environment variable for the name of file, check if it exists

parent c35a56c8
......@@ -103,8 +103,14 @@ elif [ "$DEFAULT_ANIMATION" = "false" ]; then
# Run the extraction tool
aliroot -q -b "runAnalysis.C(-1)"
ls -lh events_number.dat
n_events=$(cat events_number.dat) # stores number of events in ESD file
# Check if events_number.dat file exists
if ! [[ -e ${FILE_WITH_NUMBER_OF_EVENTS} ]]; then
echo "File $FILE_WITH_NUMBER_OF_EVENTS does not exist. Abort."
n_events=$(cat ${FILE_WITH_NUMBER_OF_EVENTS}) # stores number of events in ESD file
if ! [[ "$n_events" =~ ^[0-9]+$ ]]; then # verifies whether n_events is an integer
echo "Failed to extract number of events from file."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment