1
0
Fork 0
mirror of synced 2024-06-01 09:59:44 +12:00
bulk-downloader-for-reddit/scripts/extract_successful_ids.sh
2021-05-01 13:24:37 +10:00

18 lines
287 B
Bash
Executable file

#!/bin/bash
if [ -e "$1" ]; then
file="$1"
else
echo 'CANNOT FIND LOG FILE'
exit 1
fi
if [ -n "$2" ]; then
output="$2"
echo "Outputting IDs to $output"
else
output="successful.txt"
fi
grep 'Downloaded submission' "$file" | awk '{ print $(NF-2) }' >> "$output"