Skip to content

Instantly share code, notes, and snippets.

@colemanm
Created August 29, 2013 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colemanm/6383559 to your computer and use it in GitHub Desktop.
Save colemanm/6383559 to your computer and use it in GitHub Desktop.
Unrar password protected archives from a txt list of archive files.
#!/usr/bin/env ruby
# Requires the rar utility
# apt-get install rar
# List of filenames to be extracted
l = File.read(ARGV[0])
# Password
p = ARGV[1]
l.each_line do |l|
a = l.strip
`rar x -p#{p} #{a}`
puts "Archive #{a} extracted."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment