Can anyone here tell me why a2ps behaves differently if given command line arguments in a shell script versus on an actual command line? Typing this works: a2ps -o - <ascii-file >file.ps that is, a2ps delivers its output to stdout, as its docs say. Putting this in a file fails: #!/bin/bash a2ps -o - that is, a2ps sends its output to the printer when the above file is invoked like this: script <ascii-file >file.ps I've never had a command behave differently like this; it's driving me crazy! It's as though a2ps knows whether it's being invoked in a shell script or not, and cares. Is this a well-known aspect of a2ps? Is there a workaround? It's not in their website faq. I tried using --output=- as well as -o; same result. I'd really hate to have to type all the options a2ps demands when I need to use it. FWIW, I'm using v4.13, which seems to be the latest on the a2ps website. Alternatively, can someone suggest another filter for printing ascii text that allows control over tab spacing, ie. 4 spaces instead of 8? TIA, Jim
Hello, On Jan 8 00:48 Jim wrote (shortened):
a2ps -o - <ascii-file >file.ps
that is, a2ps delivers its output to stdout, as its docs say.
Putting this in a file fails:
#!/bin/bash a2ps -o -
that is, a2ps sends its output to the printer when the above file is invoked like this:
script <ascii-file >file.ps
I cannot reproduce it. For me (using SUSE LINUX 9.2) it works as you expect it to work. Perhaps there is a strange environment setting for the user who runs the script? Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5 Mail: jsmeix@suse.de 90409 Nuernberg, Germany WWW: http://www.suse.de/
On Mon, Jan 17, 2005 at 5:03:59PM +0100, Johannes Meixner wrote:
On Jan 8 00:48 Jim wrote (shortened):
Putting this in a file fails:
#!/bin/bash a2ps -o -
that is, a2ps sends its output to the printer...
I cannot reproduce it. For me (using SUSE LINUX 9.2) it works as you expect it to work. Perhaps there is a strange environment setting for the user who runs the script?
I suspect something like that was the problem. I eventually found the expanded docs at: http://www.inf.enst.fr/~demaille/a2ps/ where it mentions: " Only a single destination is possible at a time, i.e., if ever there are several options `-o', `-P' or `-d', the last one is honored. " so probably there was a -P or a -d somewhere else in the processing chain. Once I'd read the full docs, I was able to set all my options in one go in /etc/a2ps-site.cfg and get busy printing. I'd recommend anyone using a2ps to read the docs at the link above. Cheers, Jim
participants (2)
-
Jim
-
Johannes Meixner