Created
August 25, 2016 18:26
-
-
Save rhwlo/8b5accadc6d086924a59e36d13644f35 to your computer and use it in GitHub Desktop.
background a process in another shell by pid, for @vruba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ppid_tty=$(readlink /proc/$(cut -d' ' -f4 /proc/$1/stat)/fd/0) | |
kill -TSTP $1 && (/bin/echo "backgrounded $1" >> $ppid_tty) && kill -CONT $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment