Skip to content

Instantly share code, notes, and snippets.

@s-tajima
Created July 3, 2012 08:14
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 s-tajima/3038421 to your computer and use it in GitHub Desktop.
Save s-tajima/3038421 to your computer and use it in GitHub Desktop.
Output file lists.
target_dir = "PATH/TO/TARGETDIR"
output_dir = "PATH/TO/OUTPUTDIR"
Dir.chdir(target_dir)
for i in Dir.glob("*").sort.each
f = open(output_dir + i + ".txt", "w")
Dir.chdir(i)
for rpm in Dir.glob("*").sort.each
f.write(rpm + "\n")
end
f.close
Dir.chdir(target_dir)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment