Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # encoding: utf-8
- require 'fileutils'
- include FileUtils
- @files = %w[foo bar baz]
- @dir = '/root'
- sudo do
- puts Process.uid # => should print 0
- @files.each { |f| cp(f, @dir) }
- end
- puts Process.uid # => should print 501 or whatever
Add Comment
Please, Sign In to add comment