Skip to content

Instantly share code, notes, and snippets.

@noahpryor
Last active May 9, 2022 14:42
Show Gist options
  • Save noahpryor/1b100f860e3b1ba48f7cde971fc7d4bc to your computer and use it in GitHub Desktop.
Save noahpryor/1b100f860e3b1ba48f7cde971fc7d4bc to your computer and use it in GitHub Desktop.
Loop and archive
# Assumes a file named gam-archive2.sh exists in the same folder
# along with a file named emails.txt that includes one email prefix per line of the people you want to delete
# e.g. something like this - no # symbols
# noah
# mike
#
# read the
emails = File.read("emails.txt").lines.map(&:chomp)
puts "#{emails.length} emails found in emails.txt"
# run the script for each email
emails.each do |email|
puts `sh gam-archive2.sh #{email} mail`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment