Skip to content

Commit

Permalink
Update CreateMyList.sh
Browse files Browse the repository at this point in the history
Rather than passing the path of the RAWData file to the bash script, add it hard coded. Not great practice but this script is used for a very specific purpose to generate a list file containing part files from the RAWData, and the data location has not changed in years (and likely won't change for now).
  • Loading branch information
S81D authored Oct 2, 2024
1 parent 2f27729 commit 496822f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions configfiles/PreProcessTrigOverlap/CreateMyList.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
if [ "$#" -ne 2 ]; then
echo "Usage: ./CreateMyList.sh DIR RUN"
echo "Specified input variable must contain the directory where the files are stored, second variable run number"
if [ "$#" -ne 1 ]; then
echo "Usage: ./CreateMyList.sh RUN"
echo "Specified input variable must contain the run number"
exit 1
fi

FILEDIR=$1
RUN=$2
RUN=$1
DIR=/pnfs/annie/persistent/raw/raw/

NUMFILES=$(ls -1q ${FILEDIR}/RAWDataR${RUN}* | wc -l)
NUMFILES=$(ls -1q ${DIR}${RUN}/RAWDataR${RUN}* | wc -l)

echo "NUMBER OF FILES IN ${FILEDIR}: ${NUMFILES}"
echo "NUMBER OF FILES IN ${DIR}${RUN}: ${NUMFILES}"

rm my_files.txt

for p in $(seq 0 $(($NUMFILES -1 )))
do
echo "${FILEDIR}/RAWDataR${RUN}S0p${p}" >> my_files.txt
echo "${DIR}${RUN}/RAWDataR${RUN}S0p${p}" >> my_files.txt
done

0 comments on commit 496822f

Please sign in to comment.