-
-
Save rdela/09631a311b98bd1c1630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# batch.sh | |
# | |
# Copyright (c) 2013 Don Melton | |
# | |
# This version published on June 8, 2013. | |
# | |
# Batch control for the "encode.sh" script. | |
# | |
# Input is read from a file named "queue.txt" which must be in the same | |
# directory as this script. The queue format is extremely simple. It's just a | |
# carriage return-delimited list of full paths to media files. The paths can | |
# contain spaces and shouldn't be quoted. | |
# | |
# The path is first deleted from the "queue.txt" file and then passed as an | |
# argument to the "encode.sh" script. To pause encoding after the "encode.sh" | |
# script returns, simply insert a blank line at the top of the "queue.txt" | |
# file. | |
# | |
# The "encode.sh" script must also be in the same directory as this script. | |
# | |
# Usage: | |
# | |
# ./batch.sh | |
# | |
work="$(cd "$(dirname "$0")" && pwd)" | |
queue="$work/queue.txt" | |
input="$(sed -n 1p "$queue")" | |
while [ "$input" ]; do | |
sed -i '' 1d "$queue" || exit 1 | |
"$work/encode.sh" "$input" | |
input="$(sed -n 1p "$queue")" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment