#!/bin/bash #alias sas94 is the path to sas executable export sas94=/sz/sm94/sashome/SASfoundation/9.4/sas # alias P is the path to the sas program killps.sas export P=/pt/SOM/ #SAS94 executes killps.sas program and outputs to log filename killps.log sas94 P/killps.sas -log P/killps.log #change permission on Ppid.txt chmod 775 pids=/SA/Ppid.txt # do while loop - read in the variable pids and skips over the header column in the file. #Also the program loops through the file and kill each Ppid value grep -v "Ppid" pids| while read f1; do echo "$f1" kill-9 $f1 done #this script remove orphans from work directory.The cleanwork function is own by root. #Sudo and password are needed to execute the script below. The password is passed from db_auth.cfg file without getting prompted. export cleanwork = 'sudo -S apt-get update <~ $P/db_auth.cfg /szz/sashome/Sasfoundation/bin/cleanwork /sn/works' export cleanwork93 = 'sudo -S apt-get update <~ $P/db_auth.cfg /szz/sashome/Sasfoundation/bin/cleanwork /sn/works' #run cleanwork cleanwork #run cleanwork93 cleanwork93
From novice to tech pro — start learning today.