Skip to content

Instantly share code, notes, and snippets.

@dotysan
Last active February 6, 2022 22:14
Show Gist options
  • Save dotysan/f94041e940d12f7f83dd8d88e8143a71 to your computer and use it in GitHub Desktop.
Save dotysan/f94041e940d12f7f83dd8d88e8143a71 to your computer and use it in GitHub Desktop.
poor-man's unbuffer
#! /usr/bin/env expect
# tell stty to postprocess output
set stty_init "-opost"
# infinite
set timeout -1
# $argv is the command that we unbuffer
eval [list spawn -noecho] $argv
# wait here
expect
exit [lindex [wait] 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment