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
echo "####### add ${SOLARISANADIR}/armory into PATH"
###########################
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'
2023-04-04 14:47:44 -04:00
alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/data/RunTimeStamp.dat'
function ShowRunSize {
if [ $# -ne 1 ]; then
echo 'Please set run number '
return 0
fi
source $SOLARISANADIR/working/expName.sh
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
du -hc $SOLARISANADIR/data_raw/data/${expName}_${RUN}_*.sol
}