kinda new to shell script and trying to run the following dsjob command from the script..and get jobnames of my project
the error i get is
script.sh[2]: devtest: not found
Invalid arguments: dsjob -ljobs <project>
Status code = -9999 DSJE_DSJOB_ERROR
**************************************************
#!/usr/bin/ksh
project= devtest
export project
DSBIN=`cat /.dshome`/bin
export DSBIN
cd `cat /.dshome`
. ./dsenv
DSCMDEXE="$DSBIN/dsjob"
export DSCMDEXE
cmdstring=`$DSCMDEXE -ljobs $project`
export cmdstring
echo "$cmdstring"
******************************************
Thanks.
shell script for dsjob command
Moderators: chulett, rschirm, roy
script.sh[2]: devtest: not found
means line #2 has an error (probably the space after the = sign)
Also consider using explicit hostname, userid, and password notation with dsjob.
means line #2 has an error (probably the space after the = sign)
Also consider using explicit hostname, userid, and password notation with dsjob.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Yup , it worked, but i didnt use the hostname, userid or password. BTW what would the syntax bekcbland wrote:script.sh[2]: devtest: not found
means line #2 has an error (probably the space after the = sign)
Also consider using explicit hostname, userid, and password notation with dsjob.
dsjob -ljobs hostname userid pswd project
thanks for notifying the error..
When I am trying to get the parametrs for my job froma project the script is not giving the required output.
***************************************
#!/usr/bin/ksh
project=devtest
export project
jobname=test1
export jobname
DSBIN=`cat /.dshome`/bin
export DSBIN
cd `cat /.dshome`
. ./dsenv
DSCMDEXE="$DSBIN/dsjob"
export DSCMDEXE
cmdstring='$DSCMDEXE -lparams $project $jobname'
export cmdstring
echo "$cmdstring"
***********************************
the output is $DSCMDEXE -lparams $project $jobname
Any suggestions please?
Thanks
***************************************
#!/usr/bin/ksh
project=devtest
export project
jobname=test1
export jobname
DSBIN=`cat /.dshome`/bin
export DSBIN
cd `cat /.dshome`
. ./dsenv
DSCMDEXE="$DSBIN/dsjob"
export DSCMDEXE
cmdstring='$DSCMDEXE -lparams $project $jobname'
export cmdstring
echo "$cmdstring"
***********************************
the output is $DSCMDEXE -lparams $project $jobname
Any suggestions please?
Thanks
Because you are exporting the final 'command string' not actually executing it.
Change:
To:
and see if that works more better.
Change:
Code: Select all
export cmdstring
Code: Select all
eval ${cmdstring}
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks Chulett, it worked.chulett wrote:Because you are exporting the final 'command string' not actually executing it.
Change:
To:Code: Select all
export cmdstring
and see if that works more better.Code: Select all
eval ${cmdstring}