Help to understand the script

Hi All;
Is there anybody can explain this script please?

[code]trap 'C_logmsg "F" "CNTL/c OS signal trapped, Script ${G_SCRIPTNAME] terminated"; exit 1' 2
trap 'C_logmsg "F" "Kill Job Event sent from the Console, Script ${G_SCRIPTNAME] terminated"; exit 1' 15

# If the user hits Control-C this line of script will be run.  
# My guess is the C_logmsg script function will log the below message somewhere, 
# and then the script will terminate with return code 1
trap 'C_logmsg "F" "CNTL/c OS signal trapped, Script ${G_SCRIPTNAME] terminated"; exit 1' 2
# If the script has a TERMINATE signal sent to it (usually when machines shutdown, etc
# the below line will again log a message using C_logmsg and exit with code 1
trap 'C_logmsg "F" "Kill Job Event sent from the Console, Script ${G_SCRIPTNAME] terminated"; exit 1' 15
#----------------------------------------------------------------------------------------------
# If the shell variable $DEBUG is set...
if [${DEBUG} ]; then
# The shell will turn on its internal debug and verbosity, displaying lots of messages
# to the user who runs the script.
set -xv; # Verbose Trace
fi
# Set the variable DOC_SCRIPTS to the string value of the contents of
# the variable $CONTROL_BASE with "/scripts" concatenated on the end.
# For example if CONTROL_BASE="/home/user1" then
# DOC_SCRIPTS would now equal "/home/user1/scripts"
typeset DOC_SCRIPTS=${CONTROL_BASE}/scripts
# Set the variable DOC_ARCHIVE to the string value of the contents of
# the variable $FileNet with "/archive" concatenated on the end
typeset DOC_ARCHIVE=${FileNet}/archive
# Set the variable DOC_SSI to the string value of the contents of
# the variable $CONTROL_BASE with "/ssi" concatenated on the end
typeset DOC_SSI=${CONTROL_BASE}/ssi
# Change the current working directory to the value of the contents of
# the variable $DOC_SCRIPTS.
cd ${DOC_SCRIPTS}
# Split the value of the contents of the variable $CONTROL_BASE into
# pieces delimited by the character "/" and place the 4th value into the variable
# DOC_LEVEL.  For example if $CONTROL_BASE="a/b/c/d/e" then
# DOC_LEVEL would equal "d"
typeset DOC_LEVEL=`echo ${CONTROL_BASE}|cut -d/ -f4`
# "source" the script located in the file denoted by the contents of the 
# values of the variables below. Sourcing a file is slightly different from running
# a script in that it will keep all the values of variables and functions defined within
# the new script.  This does not happen if the script is simply run.
. ${DOC_SSI}/DCS_${DOC_LEVEL}01_${HOSTNAME}.ssi
# "source" the script located in the file denoted by the contents of the 
# values of the variables below. 
. /cm/vgi/etc/ssi/DCS_${DOC_LEVEL}01_${HOSTNAME}_secure.ssi.v1

I hope this is clearer...

1 Like

Thank you so much buddy.

---------- Post updated at 04:27 PM ---------- Previous update was at 04:22 PM ----------

Hi can you tell me
find /opt/test/log -type f -name "*.log.*" -mtime +30 | wc -l is not working.
I ahve t find out the file which is older than 30 days.

Thanks

That looks good to me...finding files that are older than 30 days.