Created
July 25, 2017 17:41
-
-
Save Sailias/ba98c603def206ff1a04b44abdf9b90e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
RED='\033[0;31m' | |
YELLOW='\033[1;33m' | |
NC='\033[0m' | |
CONTINUE_PROCESSING=true | |
while $CONTINUE_PROCESSING; do | |
# Read the next line to process | |
line=$(head -n 1 files/queue.txt) | |
if [ ${#line} -gt 0 ]; then | |
# Remove the line from the queue | |
sed -i.bak '1d' files/queue.txt | |
printf "${YELLOW} processing $line ${NC}\n" | |
# Your download here | |
# Flag the line as complete | |
echo $line >> files/complete.txt | |
else | |
CONTINUE_PROCESSING=false | |
printf "${RED} processing complete ${NC}\n" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment