basic script help

Feel free to talk about anything and everything in this board.
Post Reply
mishou
Newbie
Newbie
Posts: 6
Joined: December 22nd, 2009, 12:09 pm

basic script help

Post by mishou »

Hi,

I'm trying to convert mp4 to avi
I started with a script that list mp4 (or mkv) files and then process them but I'm stuck at the first step
The list created of mp4 files has this content:
S01E08 - Veritas.mp4
S01E09 - Ouroboros.mp4
but the echoing from the for loop is not using the whole name and is using the blank spaces as separators
giving me the output like this

S01E08
-
Veritas.mp4
S01E09

my test script

#!/bin/sh
FFMPEG=/usr/bin/ffmpeg
MEDIAINFO=/usr/bin/mediainfo
FOLDER="/media/Volume0/TV/House of Lies/Season 1"
EPLIST=/home/mishou/list-files.txt

echo $FOLDER
cd "$FOLDER"
ls |grep mp4 > $EPLIST
ls |grep mkv >> $EPLIST

for EPISODE in `cat $EPLIST`
do
echo $EPISODE
# process episode
done

any ideas of what I'm doing wrong ?

Thank you
Mishou
User avatar
sander
Release Testers
Release Testers
Posts: 9120
Joined: January 22nd, 2008, 2:22 pm

Re: basic script help

Post by sander »

Why not use awk?

cat $EPLIST | awk '{ print "here it is:" $0 }'
mishou
Newbie
Newbie
Posts: 6
Joined: December 22nd, 2009, 12:09 pm

Re: basic script help

Post by mishou »

Yes that worked.
Thanks
Post Reply