Skip to content

Instantly share code, notes, and snippets.

@eckardm
Created July 17, 2018 15:28
Show Gist options
  • Select an option

  • Save eckardm/5312ed4553114a7e9a3821da1467a654 to your computer and use it in GitHub Desktop.

Select an option

Save eckardm/5312ed4553114a7e9a3821da1467a654 to your computer and use it in GitHub Desktop.
Generated for bloggERS post entitled "Restructuring and Uploading ZIP Files to the Internet Archive with Bash."
#! /bin/bash
# Move into the directory "BC-100" (the name of our quarto scanner), then move into the subdirectory named after whichever project we're scanning, then move into a staging subdirectory.
cd BC-100/$1/$2
# Takes the plain text "list.txt," which is saved inside the staging subdirectory, and makes a new subdirectory for each identifier on the list.
cat list.txt | xargs mkdir
# For each identifier subdirectory,
for d in */; do
# Terminal moves into that directory and
cd $d
# creates three subdirectories inside named "01_JPGs_cropped,"
mkdir 01_JPGs_cropped
# "02_JP2s,"
mkdir 02_JP2s
# and "03_zipped_JP2_file," respectively.
mkdir 03_zipped_JP2_file
# It also deposits a blank text file in each identifier folder for employees to write notes in.
touch Notes.txt
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment