Advertisement

09.04.2007 at 01:59AM PDT, ID: 22804780 | Points: 500
[x]
Attachment Details

Output from ERP system. Need to append username to file using cat?

Asked by sgriffin in Linux Programming, Unix Systems Programming, Perl Programming Language

Tags: , , ,

Hi ..

I have an ERP system that uses lpr to print the text output from system.
We have a new printing server that needs a username to print ( using keyfobs to id user)
The user sent by ERP is the same user for all ( Linux application user)
Therefore if 100 different users print docs , the printing server app only sees one user.

A soloution is to output , not to lpr first , but to script.. and use cat to append to the output file , and the printing server can parse out the username.

here's my plan:

current output from ERP

lpr -P$PROFILES$.PRINTER -#$PROFILES$.CONC_COPIES -T"$PROFILES$.TITLE" $PROFILES$.FILENAME
$PROFILES$.USERNAME ( lpr does nothing at present with the username variable which is the variable we need to pass to file)

planned output

print.sh printer1 1 123456file.txt jbloggs
where
print.sh %printername% %copies% %filename% %username%

The script would need to do something like: ( keeping in mind that the output file name is unique and we need to keep this so not to mess up file names...)

cat  > output%uniquenum?%.txt
user:%username%
(exit)
cat output%uniquenum?%.txt %filename% >newfilesame_uniquenum?%.txt
lpr newfilesame_uniquenum?%.txt 1 print1

Sorry for the long question...

Anyone there to assist with correct syntax of file?

Cheers!Start Free Trial
 
Loading Advertisement...
 
[+][-]09.04.2007 at 04:42AM PDT, ID: 19824465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2007 at 05:49AM PDT, ID: 19824732

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.04.2007 at 06:17AM PDT, ID: 19824890

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2007 at 09:19AM PDT, ID: 19826299

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2007 at 05:24AM PDT, ID: 19831575

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628