First line of a Shell Script:
#!/bin/bash
Initializing Variables (Note no spaces):
SUCCESS=0
FAILURE=1
Reading a conf file (Format LOG_FILE_PATH=/home/logs/xyz):
CONF_FILE_PATH=batch_jobs.conf
LOG_FILE_PATH=$(cat ${CONF_FILE_PATH} | grep LOG_FILE_PATH= | gawk -F = '/./ {print $2}')
Functions (Example function to check if java command exists):
function init
{
echo "Initialising Import Script"
JAVA_EXECUTABLE_LOCATION=$(which ${JAVA_EXECUTABLE})
if [[ -z "${JAVA_EXECUTABLE_LOCATION}" ]] ; then
echo "Unable to execute import script as the import executable [${JAVA_EXECUTABLE}] is not on the path"
exit ${FAILURE}
fi
}
Function: (Execute java command)
App_AAA_BBB_args=$(cat ${CONF_FILE_PATH} | grep App_Align_Sequences_args= | gawk -F = '/./ {print $2}')
App_XXX_YYYY_jar=$(cat ${CONF_FILE_PATH} | grep App_Align_Sequences_jar= | gawk -F = '/./ {print $2}')
function runAppXXXYYYYY
{
echo "java -Xmx4g -jar ${App_XXX_YYYY_jar} ${App_AAA_BBB_args} 2>&1 | tee -a ${LOG_FILE_PATH}/App_App_XXX_YYYY.log"
java -Xmx4g -jar ${App_XXX_YYYY_jar} ${App_AAA_BBB_args} 2>&1 | tee ${LOG_FILE_PATH}/App_XXX_YYYY.log
}
Calling Functions:
init
runAppYYYYXXXX #function name
exit ${SUCCESS}
Subscribe to:
Post Comments (Atom)
Azure OpenAI Architecture Patterns & Deployment Patterns
Sharing some useful links that will help customers architect Azure OpenAI solution using the best practices: (1) Azure OpenAI Landing Zone r...
-
Setting up a MPI cluster on Ubuntu involves the following steps: 1. Install OpenMPI on all machines. $sudo apt-get install libopenmpi-de...
-
Very Useful Link: http://people.cc.ku.edu/~grobe/intro-to-LSL/index.html#particle Using the Linden Script Language This page is a short...
-
float p_size = 0.1; default { state_entry() { llSay(0, "Hello, Avatar!"); llSetPrimitiveParams( [ PRIM_...
No comments:
Post a Comment