Skip to content

Instantly share code, notes, and snippets.

@hepplerj
Last active December 28, 2015 15:39
Show Gist options
  • Save hepplerj/7522868 to your computer and use it in GitHub Desktop.
Save hepplerj/7522868 to your computer and use it in GitHub Desktop.
A bash script that iterates through a directory of files and uses Omekadd to upload .yaml and .pdf files to Omeka.
#!/bin/bash
# Written by Jason A. Heppler
# Iterate through the base directory, find all .yaml files and .pdf files, and
# upload these files to Omeka. For use with Caleb McDaniel's Omekadd Python
# script: https://github.com/wcaleb/omekadd
#
# Last Modified: 2013-11-17
# The script assumes the .yaml and .pdf share the same filename, so the two can
# be matched together for upload (e.g., item001.yaml belongs with item001.pdf).
for i in *.yaml ; do
# the pdf file will have the same filename as the yaml file
filename_pdf=${i/%?????/}.pdf
# upload to Omeka
python /Users/jheppler/git/omekadd/omekadd.py $i -u $filename_pdf
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment