logoalt Hacker News

jmclnxlast Thursday at 2:23 PM2 repliesview on HN

Thanks, links saved.

Then there is this method, but I guess that article refers to no redirection output.

If in background or via cron, I always redirect. But this is for UN*X type systems with a tail that supports '-f'

$ prog > /tmp/log.txt 2>&1 &

Then

$ tail -f /tmp/log.txt

Just so happens, I actually used this the other day for a long running process on OpenBSD :)


Replies

smcameronlast Thursday at 3:22 PM

Can't you just read from /proc/pid/fd/0 ?

show 2 replies
hmnglast Thursday at 2:44 PM

Isn't that what tee is for? Like

$ prog | tee /tmp/log.txt

show 2 replies