Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
Script exiting loop after processing first item?
Post Flair (click to view more posts with a particular flair)
Post Body

So I've got this little script that processes video files for me.

#!/bin/bash
cd /mnt/media/vert/input/

ls -1 | while read line; do
  cat=`echo "$line" | sed 's/ .*//'`

  if [ "$cat" == "Movie" ]; then
    echo "This is a movie!"
    /mnt/media/util/autovert-movie.sh "$line"
  elif [ "$cat" == "TV" ]; then
    echo "This is a TV show!"
    /mnt/media/util/autovert-tv.sh "$line"
  elif [ "$cat" == "TVl" ]; then
    echo "This is a long TV show!"
    /mnt/media/util/autovert-tvl.sh "$line"
  elif [ "$cat" == "Premium" ]; then
    if [[ "$line" == *"Kevin Ryan"* ]]; then
      echo "This is another Kevin Ryan short!"
      /mnt/media/util/autovert-kevin.sh "$line"
    fi
  else
    echo "I don't know what this is, so I'll leave it be."
  fi
done

echo "All done!"
exit

In /mnt/media/vert/input I currently have the following files for testing:

TV - Bigfoot and Wildboy - Secret Monolith.mkv
TV - Bigfoot and Wildboy - Sonic Projector.mkv
TV - Bigfoot and Wildboy - The Trappers.mp4
TV - Bigfoot and Wildboy - The White Wolf.mkv
TV - Bigfoot and Wildboy - UFO.mkv

If I run the script, it passes control to autovert-tv.sh like it's supposed to, which processes the first file in the list (in this case, TV - Bigfoot and Wildboy - Secret Monolith.mkv), and then exits (with the "All done!" message) instead of moving on to the next file in the loop.

Why is my loop not actually looping?

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
19,425
Link Karma
6,051
Comment Karma
13,278
Profile updated: 5 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago