Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • OK, because .bash_profile is called on login shells and the normal GUI login doesn't have a terminal, so the only terminal login shell should be a tty. Good find Commented Oct 17, 2013 at 11:07
  • 1
    If this snippet were included in a larger script that had its stdin redirected from a file, it would report that no TTY is available even if run from a VT. Commented Oct 17, 2013 at 11:59
  • 1
    @JosephR Correct. The value is often with cron or at jobs to avoid failures when scripts assume interactive input. Commented Oct 17, 2013 at 12:34