1 2 3 4 5 6 7 8 9 10
#!/bin/sh -e for tracked_dir in ~/.config/automedia/rss/tracked/* ~/.config/automedia/html/tracked/*; do cat "$tracked_dir/updated" echo " " $(basename "$tracked_dir") done | sort -nr | while IFS= read -r line; do timestamp=$(date -d @$(echo "$line" | cut -d' ' -f1)) tracked_item=$(echo "$line" | cut -d' ' -f2-) echo "$timestamp" "|" "$tracked_item" done