0

I run a script and print the output (out & err) to a file.

sudo <myScript> 2>&1 | sudo tee -a /path/output.txt

when I delete the outputfile everything seems to be ok (in terminal view).

sudo rm /path/output.txt

file is not there anymore, script runs as before.

But where my prints are going to now? Is it possible that the output.txt is automatically created (blank) again when it was deleted and the prints from my script where now logged in this blank output.txt? (without restarting the script from ssh)

eid
  • 537
  • 5
  • 12
  • [What happens to an open file handle on Linux if the pointed file gets moved, delete](https://stackoverflow.com/q/2028874/608639), [Why does the rm command not remove the file?](https://stackoverflow.com/q/40576833/608639), [How exactly does unlink work?](https://stackoverflow.com/q/26487027/608639), [Where do files go when the rm command is issued?](https://unix.stackexchange.com/q/10883), etc. – jww May 23 '19 at 12:46
  • thanks for the nice collocation – eid May 23 '19 at 12:57

0 Answers0