Skip to content

Instantly share code, notes, and snippets.

@danhigham
Created July 8, 2011 19:19
Show Gist options
  • Save danhigham/1072592 to your computer and use it in GitHub Desktop.
Save danhigham/1072592 to your computer and use it in GitHub Desktop.
Forking a process and getting it's pid
#!/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