mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:39:02 -08:00
exit early if dd
fails
This commit is contained in:
parent
c0586e4442
commit
99fa691e1b
1 changed files with 1 additions and 1 deletions
2
sh/glug
2
sh/glug
|
@ -96,7 +96,7 @@ glug() ( # note the subshell syntax. this allows us to abuse globals like crazy.
|
|||
old="$(stty -g)"
|
||||
trap 'stty "$old"' INT EXIT
|
||||
stty -icanon -echo
|
||||
dd ibs=1 count=1 2>/dev/null
|
||||
dd ibs=1 count=1 2>/dev/null || exit
|
||||
echo _ # append an underscore so that newlines are preserved in captures
|
||||
} </dev/tty # ensure this interacts with a terminal instead of a pipe
|
||||
|
||||
|
|
Loading…
Reference in a new issue