IBM Sterling Connect:Direct : Script to get process in HOLD and WAIT queue

This script get the output from command "sel pro", and generate a file for process in HOLD, WAIT. The script can output the result from a list of process by name.

= Script = set +vx NDMAPICFG=/home/cdadmin02/cdunix/ndm/cfg/cliapi/ndmapi.cfg export NDMAPICFG selpro_output=$(/home/cdadmin02/cdunix/ndm/bin/direct -s << EOJ selpro; EOJ ) count=$(echo "$selpro_output" | grep -c "HOLD" ) if [ $count -gt 0 ]; then echo "processos em HOLD - $count vezes:" > processo_HOLD.out else echo "" > processo_HOLD.out fi count=$(echo "$selpro_output" | grep -c "WAIT" ) if [ $count -gt 0 ]; then echo "processos em WAIT - $count vezes:" > processo_WAIT.out else echo "" > processo_WAIT.out fi strings=("COPY2SFG" "processo2" "processo3") for str in "${strings[@]}"; do    # conta HOLD ou WAIT e conta o processo count=$(echo "$selpro_output" | grep -e "HOLD" -e "WAIT" | grep -c "$str") if [ $count -gt 0 ]; then echo "O processo '$str' ocorre $count vezes:" > processo_"$str".out else echo "" > processo_"$str".out fi done
 * 1) !/bin/bash
 * 1) Execute sel pro command
 * 1) Output the number of process in HOLD
 * 1) Output the number of process in WAIT
 * 1) Define process PNAME

= Ver também =


 * Artigos sobre IBM Sterling


 * Artigos sobre Cloud
 * Mais Artigos sobre Cloud / WebDev / Tecnologias