On Mon, 24 Jun 2002, David Coello wrote:
> I load lp5250 with outputcommand='scs2ascii > /as400/scs$$$.txt'
> but when i print i get a file scs623.txt (for example) sized 0 bytes.

I can't think of anything that would cause the exact symptom you're
posting.  If you told me that the 0 byte file was actually called
scs623.txt' (with a quote at the end) then it would make sense.

I do see something wrong with your syntax, so I'll try to explain it:

If you're doing a command line:

       lp5250d outputcommand='scs2ascii > /as400/scs$$$.txt'

Then, (at least on my system) the shell is passing the following arguments
to lp5250d:

 arg 0: lp5250d
 arg 1: outputcommand='scs2ascii
 arg 2: >
 arg 3: /as400/scs$$$.txt'

This works out this way because the quote is not at the beginning of the
argument, but rather in the middle.   That problem can be easily fixed
simply by typing:

       lp5250d 'outputcommand=scs2ascii > /as400/scs$$$.txt'

by surrounding the entire argument with the quotes, the shell passes the
whole thing as one arguemnt to the program (which is what we're looking

However, if you're putting this in a ~/.tn5250rc or ${prefix}/etc/tn5250rc
config file, it creates a completely different problem.   Those config
files do not observe shell syntax (since they're not handled by the shell)
The entire argument gets passed to popen() verbatim.

Therefore, it ends up trying to execute a program called
'scs2ascii > /as400/scs$$$.txt' (it thinks that all of that, including the
spaces, etc, are part of the program name) and can't find it, so it fails.

At any rate, the quoting is not needed in the config file, so if this
is going into a tn5250rc, just omit the quoting:

      outputcommand = scs2ascii > /as400/scs$$$.txt

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.