This is a discussion on Korn Shell scripting question - suggestions requested within the AIX Operating System forums, part of the Unix Operating Systems category; --> I have a question regarding a printer script problem I am trying to resolve. My company has a postscript ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a question regarding a printer script problem I am trying to resolve. My company has a postscript file that is produced from Oracle and prints custom timesheets. For some reason, it has a default call for A4 paper - this errors out the print job and some printers handle it and we can override and print while other printers don't and the output is flushed at the device. I wrote a custom backend for AIX that includes a substitution of 'letter' for 'exec - or A4'. This fixed that error but created another. All landscape print was directed to this and other problems resulted. So, I wrote a test to see if the file was a postscript or not, but this required a relative variable - if [[ `head -1 $@ | grep -i Adobe | echo $?` = 0 ]];then print "We have hit" fi The sed substitution would go on the "We have hit" line. The problem now is that I can't get the script to recognize and pass the relative var for the printfile to the enclosed head command. So I tried another call with: cat /etc/motd > /tmp/motd.out This will produce output if I run it from the command line against a canned printfile. But it won't produce output if generated by the qdaemon from Oracle. So I am having trouble debugging this. Do you know anyone who has print and Kornshell expertise that I could talk to about this? Any suggestions would be much appreciated. Thanks, |
| ||||
| >>if [[ `head -1 $@ | grep -i Adobe | echo $?` = 0 ]];then >>print "We have hit" >>fi this is ugly.....and it wont work (you should use Adobe ; echo $?) try using if head -1 $@ | grep -i adobe >/dev/null then print "we have hit" fi -- Posted via http://dbforums.com |