SOLARIS_Analysis/SOLARIS.sh

49 lines
1.0 KiB
Bash
Raw Normal View History

2023-04-04 14:47:44 -04:00
#!/bin/bash
2023-03-31 16:08:06 -04:00
#========== this script define the SOLARISANADIR as global env.
unset SOLARISANADIR
2023-03-28 17:09:58 -04:00
SOURCE=${BASH_ARGV[0]}
PCName=$(uname -n)
if [ $(uname -n) == "solaris-daq" ]; then
2023-03-31 16:08:06 -04:00
SOLARISANADIR=~/Analysis
2023-03-28 17:09:58 -04:00
else
2023-04-04 14:47:44 -04:00
ABSPATH=$(realpath ${SOURCE})
SOLARISANADIR=$(dirname ${ABSPATH})
2023-03-28 17:09:58 -04:00
fi
2023-03-31 16:08:06 -04:00
export SOLARISANADIR
echo "####### set global variable SOLARISANADIR = ${SOLARISANADIR}"
export PATH=$PATH:$SOLARISANADIR/Armory
2023-03-31 16:08:06 -04:00
echo "####### add ${SOLARISANADIR}/Armory into PATH"
2023-03-31 16:08:06 -04:00
###########################
2023-04-04 14:47:44 -04:00
echo "####### Define BASH Alias / Functions for SOLARIS"
2023-03-31 16:08:06 -04:00
alias 2Working='cd ${SOLARISANADIR}/working'
alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/RunTimeStamp.dat'
2023-04-04 14:47:44 -04:00
function ShowRunSize {
if [ $# -ne 1 ]; then
echo 'Please set run number '
return 0
fi
2024-07-02 15:26:21 -04:00
source $SOLARISANADIR/data_raw/expName.sh
2023-04-04 14:47:44 -04:00
RUN=$1
if [ ${RUN} = "latest" ]; then
RUN=${runID}
fi
runLen=${#RUN}
if [ ${runLen} -eq 1 ]; then
RUN="00"${RUN}
elif [ ${runLen} -eq 2 ]; then
RUN="0"${RUN}
fi
2024-07-02 15:26:21 -04:00
du -hc $SOLARISANADIR/data_raw/${expName}_${RUN}_*.sol
2023-04-04 14:47:44 -04:00
}