1833875 Members
2879 Online
110063 Solutions
New Discussion

Re: print to file

 
Chris Watson
Super Advisor

print to file

I have created a dumb printer and have been trying to modify the script to output to a file instead of a real printer.

The line in the original script that appears to finally talk to the printer is;

cat "$file" 2>&1

Whilst a little bit unclear on the 'reaction' to this cat, it must be being piped upstream, I had hoped that simply modifying the line to do a suitable 'cp' would do the trick.

Having tried a few different things, can someone now give me the answer?

Thanks,
CW
Moving along nicely
5 REPLIES 5
Peter Godron
Honored Contributor

Re: print to file

Chris,
can you confirm:
1. The script currently prints to a printer
2. Where is the printer defined as the output

Can you just run the script( with all the required parameters) and redirect the data?
i.e.
script.sh par1 par2 > file.txt 2>&1

Regards
Peter Godron
Honored Contributor

Re: print to file

Chris,
any update on this?
if the the problem is resolved, could you please close the thread?
Thanks
Peter Godron
Honored Contributor

Re: print to file

Chris,
is this problem resolved? If it is please enter the solution and close.
If it is not fixed can you please update.
Chris Watson
Super Advisor

Re: print to file

I decided to create a pipe and print to that, then created a listening to drop it into the filesystem.
Moving along nicely
Chris Watson
Super Advisor

Re: print to file

close
Moving along nicely