move-to-watched.sh 378 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. dir="$1"
  4. name="$2"
  5. list="/tmp/watched_movies.txt"
  6. tmp="${list}.temp"
  7. echo "$name" >> "$temp"
  8. cat "$temp" | sort | uniq > "$list"
  9. # mv "$dir" /media/zadca123/Elements/movies/watched
  10. # directory="${1%/*}/watched" && \
  11. # mkdir -p "$directory" && \
  12. # mv "$1" "$directory" && \
  13. # notify-send "moved"