Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.46 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. def c(cmd)
  4.   puts "CMD: #{cmd}"
  5.   puts `#{cmd}`
  6.   puts "CMD #{cmd} finished"
  7. end
  8.  
  9. current = `ls`
  10.  
  11. a = Process.fork do  
  12.     c("top")
  13. end
  14.  
  15. b = Process.fork do
  16.     c("top")
  17. end
  18.  
  19. #sleep 5
  20.    
  21. c("sleep 1")
  22. c("sleep 1")
  23. c("sleep 1")
  24. c("sleep 1")
  25. c("sleep 1")
  26. c("sleep 1")
  27. c("sleep 1")
  28. c("sleep 1")
  29. c("sleep 1")
  30. c("sleep 1")
  31. c("sleep 1")
  32. c("sleep 1")
  33. c("sleep 1")
  34. c("sleep 1")
  35. c("sleep 1")
  36. c("sleep 1")
  37. c("sleep 1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement