Page 1 of 1
Suppress status code of dsjob command
Posted: Tue Jun 20, 2006 7:52 am
by kaps
Hi
Can anyone tell me how can I suppress the return staus code value which we get after running the dsjob command ?
Thanks
Posted: Tue Jun 20, 2006 7:58 am
by ray.wurlod
Redirect stdout and stderr to /dev/null
Posted: Tue Jun 20, 2006 8:00 am
by kcbland
Instead of directly executing dsjob use a shell script that runs the dsjob command that parses the dsjob exit code and returns whatever exit codes you want.
Posted: Tue Jun 20, 2006 8:01 am
by DSguru2B
dont include the -jobstatus option along with the -run. This way you will only get either a 1 or a 0. Then you can use either Ray or Ken's suggestion to obtain your goal.
Posted: Tue Jun 20, 2006 8:30 am
by kaps
Thanks for the replies.
I am using shell script and I am not running the command.
I can't redirect my stdout to /dev/null as I need the output of the command. I need to execute the following command.
dsjob -report DS_PROJECT DS_JOB XML
If I redirect my stdout as following then everything will be ruoted to /dev/null which I don't want...
dsjob -report DS_PROJECT DS_JOB XML > /dev/null
I need the output in STDOUT but I also want to supress the return status code.
Please throw some idea...
Thanks
Posted: Tue Jun 20, 2006 9:25 am
by chulett
What the heck do you mean by 'suppress the return status code'? You can return whatever you want from the script but can't 'suppress' it - it needs to return
something. If you don't want to send back anything from dsjob - don't.
![Confused :?](./images/smilies/icon_confused.gif)
Posted: Tue Jun 20, 2006 12:04 pm
by kaps
Craig
what I meant from suppressing staus code is....If I execute the command
[b]dsjob -report Prokect_Name Job_Name XML[/b] from a shell script it gives me the job statistics and also gives me [b]Status code = 0[/b] as the last line. I don't want this status code.
Thanks
Posted: Tue Jun 20, 2006 1:34 pm
by DSguru2B
Thats the status code of the dsjob command itself. It will not show up in the xml file, if thats wht you are worried about.
Posted: Tue Jun 20, 2006 2:50 pm
by ray.wurlod
Pipe the result through grep -v Status code =