use a single log file for stdout and stderr
This commit is contained in:
parent
d2033fa31d
commit
8adba1d7c3
@ -4,8 +4,8 @@ set -e
|
||||
|
||||
SELF=$(basename "$0")
|
||||
GEN_DATA_DIR=releng_generated_data
|
||||
CLOG1=${GEN_DATA_DIR}/log.${SELF}.1
|
||||
CLOG2=${GEN_DATA_DIR}/log.${SELF}.2
|
||||
CLOG=${GEN_DATA_DIR}/log.${SELF}
|
||||
|
||||
PASSED_OPTIONS=""
|
||||
|
||||
if [ "${1}" == "-cleanup" ]; then
|
||||
@ -18,7 +18,7 @@ else
|
||||
cat << HLP
|
||||
|
||||
${SELF} runs executables from CWD starting with releng_*.
|
||||
stdout/stderr output stored in ${GEN_DATA_DIR}/log.*
|
||||
stdout/stderr output stored in ${CLOG}
|
||||
|
||||
${SELF} -rc [-keep]
|
||||
${SELF} -cleanup
|
||||
@ -28,18 +28,19 @@ HLP
|
||||
fi
|
||||
|
||||
########################################################
|
||||
> ${CLOG1}
|
||||
> ${CLOG2}
|
||||
> ${CLOG}
|
||||
DSTART=`date --utc`
|
||||
printf "\n${SELF}: Started at ${DSTART}"
|
||||
E1=`date '+%s'`
|
||||
# require ^releng_, avoid running (your)self explcitly
|
||||
for s in `ls | grep ^releng_ | grep -v ${SELF} | sort -n`; do
|
||||
if [ -x ${s} -a ! -d ${s} ]; then
|
||||
# tee(1) does trailing \n, which is unwanted in that case
|
||||
printf "\n${SELF}: Running ./${s} ${PASSED_OPTIONS}..."
|
||||
echo -e "\n${SELF}: Running ./${s} ${PASSED_OPTIONS}..." >> ${CLOG}
|
||||
T1=`date '+%s'`
|
||||
set +e
|
||||
./${s} ${PASSED_OPTIONS} 1>>${CLOG1} 2>>${CLOG2}
|
||||
./${s} ${PASSED_OPTIONS} &>> ${CLOG}
|
||||
RET=$?
|
||||
T2=`date '+%s'`
|
||||
let TS="${T2} - ${T1}"
|
||||
@ -59,13 +60,12 @@ fi
|
||||
printf "\n${SELF}: Stopped at ${DEND}.\n"
|
||||
|
||||
if [ "${1}" == "-cleanup" ]; then
|
||||
rm -f "${CLOG1}" "${CLOG2}"
|
||||
rm -f "${CLOG}"
|
||||
else
|
||||
E2=`date '+%s'`
|
||||
let ES="${E2} - ${E1}"
|
||||
printf "\n${SELF}: Total time elapsed ${ES} sec."
|
||||
printf "\n${SELF}: stdout saved in ${CLOG1}."
|
||||
printf "\n${SELF}: stderr saved in ${CLOG2}.\n"
|
||||
printf "\n${SELF}: stdout&stderr saved in ${CLOG}.\n"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user