Created
July 8, 2011 19:19
-
-
Save danhigham/1072592 to your computer and use it in GitHub Desktop.
Forking a process and getting it's pid
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
#!/usr/bin/ruby | |
pid = Process.fork do | |
exec 'ls -al' | |
end | |
puts "pid is #{pid}" | |
Process.detach pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment