Skip to content

Instantly share code, notes, and snippets.

@enebo
Created January 19, 2023 19:44
Show Gist options
  • Save enebo/c3064050f41c9cfd5f070c6ee102ea89 to your computer and use it in GitHub Desktop.
Save enebo/c3064050f41c9cfd5f070c6ee102ea89 to your computer and use it in GitHub Desktop.
enebo: ruby -I "subspawn-win32/lib" -I "subspawn/lib" -r 'subspawn' -r 'subspawn/replace-pty' -e 'm,s =PTY.open; p [m,s]; pid,j = SubSpawn.spawn(["cmd"], pty: s); sleep 5; m << "echo yes\n\r\nexit\r\n"; m.flush; p pid, j; p m.read(5); p Process.wait(pid); puts "done"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment