Emacs, scripting and anything text oriented.
Kaushal Modi

Posts tagged with ‘bash’ (4)

Nim: Check if stdin/stdout are associated with terminal or pipe

When writing bash scripts, I often need to know if the script is receiving input from the terminal, or some piped process. I would also need to know if the script is sending output to the terminal, or to another piped process.

As I am learning Nim and trying to write new scripts using that, I need to know how to do the same in Nim.