Hello,
Can you please let me know how I can list all the jobs that uses a certain environmental variable in a project.
Thanks
list of jobs using a certain environmental variable
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 236
- Joined: Sun Apr 01, 2007 7:41 am
- Location: Michigan
I wrote myself a script for that.
Code: Select all
#!/usr/bin/ksh
##
## Description: Scan all jobs in all project to see if they use a particular parameter passed to this script .
##
DSHOME=`cat /.dshome`;export DSHOME;
hName=`hostname`
set -A projects `$DSHOME/bin/dsjob -lprojects 2>/dev/null;`
for pEntry in ${projects[*]}; do
echo "Examining $pEntry"
set -A jList `$DSHOME/bin/dsjob -ljobs $pEntry 2>/dev/null;`
for jEntry in ${jList[*]}; do
$DSHOME/bin/dsjob -lparams $pEntry $jEntry 2>/dev/null | grep $1 1>/dev/null 2>/dev/null;
status=$?
if [[ $status -eq 0 ]]; then
echo "$jEntry is using $1"
fi
done
done