Commit Graph

4 Commits (bbfcb5b633464f316f6367afa826692786b05c0e)

Author SHA1 Message Date
Emilio Pinna dd337b5ddf Adopt new function names 2018-10-05 18:55:38 +01:00
Andrea Cardaci 8eaf595fe6 Make interactive execute whenever possible
Here the trick is to restore those file descriptors (0, 1, 2) that have been
redirected (`dup2`) by the parent process.

First we need to determine which one has been redirected, for example by looking
at `ls -l /proc/$$/fd/`. Then we can use `0<&x`, `1>&x` or `2>&x` to restore 0,
1 or 2 respectively, where `x` is any file descriptor number that points to the
TTY.

It may happen that no file descriptor is unchanged, in that case we can use
`tty` to perform the redirection: sh <$(tty) >$(tty) 2>$(tty)
2018-09-07 01:11:06 +02:00
Emilio Pinna 0f422cdd6a Reorder functions in git, lua, and nc 2018-07-22 15:42:43 +01:00
Emilio Pinna ef92163d03 Add git 2018-07-22 14:06:54 +01:00