0

I have a test script that contains the following:

lp -d HP ~/cap/alpha/error

HP is a designated printer on my wireless network and ~/cap/alpha/error is the full file path to the file containing the report from a python unit test.

The command works from the terminal window but not from the script called test.

I can't figure out why this is not working?

Python Jim
  • 11
  • 3

1 Answers1

0

How to pipe stdout while keeping it on screen ? (and not to a output file) (answer by jilliagre):

echo 'ee' | tee /dev/tty | foo

This answer worked for me as follows:

$ python3 "mytest.py" | tee /dev/tty/ | lp -d brother

printing to both my terminal and my printer.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Python Jim
  • 11
  • 3
  • With a bit more rep, [you will be able to flag duplicate questions like this](https://stackoverflow.com/privileges/comment). Until then, posting links as answers is not really ideal, and they will generally be deleted. – Nathan Tuggy Sep 08 '17 at 04:12