Re: Script file to customize scs2ascii output - COMPLETED!!!

"Mitch Martin" <[email protected]>
Newsgroups gmane.comp.emulators.tn5250
Message-ID <[email protected]>
Thanks to Toby and Scott for their help!

I would like share this script in hopes that it might benefit another
"bash impaired" person.

The output from scs2ascii is piped into this script.  The users name in
the document file is determined by grep.  The file is piped into
enscript where it is formatted the way that I want it.  It is then piped
into ps2pdf and output as a pdf file with the name of the user that was
determined by grep.  The date and time is also appended to the filename.

Toby, I chose not to use the colon in the time section as it causes
problems with filenames.  I'm sure that was just an oversight on your
part.  Instead of another "-", I just used the military time format.

Thanks again, both of you, for your kindness and assistance.  You made
my project go much faster than I expected!!  ;-)


Sincere regards,
Mitch Martin

 
#! /bin/bash

file=`cat /dev/stdin`
users="PHILLIP SAM RICHARD"

for user in $users; do
echo "$file" | grep $user >/dev/null &&  echo \
"$file" | enscript -Bc -f Courier9 -p - | ps2pdf - > \
/home/misadmin/"$user"_`date +%Y-%m-%d_%H%M`.pdf && break
done
-- 
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/linux5250
or email: LINUX5250-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.