Я запускаю следующий скрипт python piped в tee
#!/usr/bin/python
from sys import exit,exc_info
from time import sleep
try:
print "hello"
#raise KeyboardInterrupt
while True:
print "hello"
sleep(1)
except KeyboardInterrupt:
print "Key board Interrupt"
exit(0)
Предположим, что я сохранил это в file.py
Теперь, если я выполняю :
./file.py | tee somefile
Теперь нажмите Ctrl+C, не заметив, что ничего не печатается в somefile и stdout
При нормальном выполнении:
./file.py
[d5 ] [F12]: hello
hello
^CKey board Interrupt
Также перенаправление файлов работает нормально. Что случилось с tee