Hacker News new | ask | show | jobs
by boomlinde 2803 days ago
User friendly until the user decides to invoke that command in a cron job and ends up with a headless process waiting for additional input.
2 comments

Anyone who doesn't test cron jobs before saving them deserves whatever she gets. There are scores of ways for cronjobs to fail. b^)
Well, this is not a cronjob that failed, it's just waiting for input.

Let's say that I did test the cronjob but that it starts "failing" after an update to the tool. My fault, I know, but at least I get mail when it fails while I won't if it's just waiting for input.

This scenario would only happen if a flag became required. Prompting or not it would still be an issue. (And it wouldn't prompt as this is a non-tty environment)
> Prompting or not it would still be an issue.

Yes, but in one case the issue would result in a mail because the cron job failed, and in the other case the issue would just cause the the process to hang indefinitely without notice

NO IT WON'T HANG. I give up. I don't know how else to try to explain this to you.
It's possible to detect whether stdin or stdout is attached to a terminal, and do something different depending.