Is there any sort of a 'label' on the printout? I guess I'm hoping that the printout will have something like this:

'UserID: xxxxxxxxxx'

Then you can use grep to look for the 'UserID:' string, and use cut or awk whatever tool is appropriate to extract the actual userid. This seems like a better idea than running grep multiple times -- especially if the number of users increases.

...other than that, I'm not sure what sort of guidance you're looking for? It sounds like a very simple script to me.

Mitch Martin wrote:
Hello all,

I've been using tn5250 on a Linux server for over a year and sending i5
print sessions to Windows network printers while converting the output
to ascii, pdf and even tiff. It's the greatest thing since sliced
bread!! ;-)

I now have a need for something a little different and I'm asking for
any hints on the best way to accomplish it. (Not being a bash scripting
guru, myself)

I want to take the output of scs2ascii and search that output for a
user's name. Each output is a document containing 1 of 5 possible user
names. I then want to write that output as a file using the user name
as the filename and maybe adding the current date and time. I may want
to further process or format that output but I can probably manage that
with enscript as I've been doing.

My thoughts are to setup variables with the 5 user names and then use
grep to test for each user, check the return status code for a match and
then write the filename. That is overly simplified, of course. I'm
currently reading a shell programming book and hoping to put a script
together but would appreciate any guidance from the more experienced
programmers on this list.

Thanks for any help.


This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].