theniteowl
Programmer
Hi All,
I have no shell scripting experience. Can you tell me if the following is possible/realistically achievable?
First, I need it to issue the command "opscmd job_list" which will give a long carriage return delimited list of jobs in the print queue.
I then need to identify each line that contains the text INTERRUPTED and extract the jobnumber which is in the last 9 characters of that line.
I then need to run an additional command against each of the INTERRUPTED jobs "opscmd job_get jobnumber dest_id"
which will return a single line of text and check to see if that line contains FXQTRLY. If it contains FXQTRLY I need to issue a third command "opscmd job_hold jobnumber"
The idea is to identify jobs that are in interrupted status AND have dest_id of FXQTRLY. Unfortunately the dest_id value is not one included in the data returned by the job_list command. So I have to identify all jobs with INTERRUPTED, then test each of those jobs individually to see if they have dest_id of FXQTRLY and set them on hold if they are.
I have been attempting to automate this process using VBS to run commands through Putty but it has some severe limitations.
Can this be reasonably accomplished in a shell script on the unix server?
Does the shell scripting have the ability to store found matches in an array for processing the next step or would it have to write out to a text file then process that text file for the next step?
Any sample scripts showing how any portions of this might be accomplished? I can work well from examples and modify them to my needs.
Thanks.
At my age I still learn something new every day, but I forget two others.
I have no shell scripting experience. Can you tell me if the following is possible/realistically achievable?
First, I need it to issue the command "opscmd job_list" which will give a long carriage return delimited list of jobs in the print queue.
I then need to identify each line that contains the text INTERRUPTED and extract the jobnumber which is in the last 9 characters of that line.
I then need to run an additional command against each of the INTERRUPTED jobs "opscmd job_get jobnumber dest_id"
which will return a single line of text and check to see if that line contains FXQTRLY. If it contains FXQTRLY I need to issue a third command "opscmd job_hold jobnumber"
The idea is to identify jobs that are in interrupted status AND have dest_id of FXQTRLY. Unfortunately the dest_id value is not one included in the data returned by the job_list command. So I have to identify all jobs with INTERRUPTED, then test each of those jobs individually to see if they have dest_id of FXQTRLY and set them on hold if they are.
I have been attempting to automate this process using VBS to run commands through Putty but it has some severe limitations.
Can this be reasonably accomplished in a shell script on the unix server?
Does the shell scripting have the ability to store found matches in an array for processing the next step or would it have to write out to a text file then process that text file for the next step?
Any sample scripts showing how any portions of this might be accomplished? I can work well from examples and modify them to my needs.
Thanks.
At my age I still learn something new every day, but I forget two others.