Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. if [ -t 1 ]; then
  2. echo stdout is open to a terminal
  3. fi
  4.  
  5. $ ltrace [ -t 1 ] | cat
  6. [...]
  7. isatty(1) = 0
  8. [...]
  9.  
  10. $ strace [ -t 1 ] | cat
  11. [...]
  12. ioctl(1, TCGETS, 0x7fffd9fb3010) = -1 ENOTTY (Inappropriate ioctl for device)
  13. [...]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement