H
heckmic
Mitglied
Ich habe ein Script geschrieben, welches Dateien, die ich mit dem vdr aufgenommen habe in dvd konforme mpegs wandelt. Nun habe ich ein Problem mt der ausgabedatei.
Die Variable heißt $VDRFILE und der Inhalt ist z.B:
/mnt/ftp/tv/Verliebt_in_Berlin/_/2006-08-23.19.05.99.99.rec/001.vdr
das ist auch so ok, nun möche ich aber eine Variable haben ($VDROUT) die als Inhalt das hier hat:
/mnt/ftp/tv/Verliebt_in_Berlin/_/2006-08-23.19.05.99.99.rec/001.mpg
also die letzten 3 Zeichen des Strings dur "mpg" ersetzen.
Wie kann ich das machen?
Hier das Script:
#!/bin/sh
date >> /mnt/ftp/tv/convert.log
/etc/init.d/vdr stop
/etc/init.d/vdradmin-am stop
VDRFILE=`find /mnt/ftp/tv -mtime +1 | grep 00..vdr -m 1`
VDROUT=$VDRFILE
nice -20 tovid -in "$VDRFILE" -out "$VDROUT" -pal -half-dvd
echo "VDR Datei bearbeitet $VDRFILE" >> /mnt/ftp/tv/convert.log
rm "$VDRFILE"
echo "QUELLDATEI $VDRFILE geloescht" >> /mnt/ftp/tv/convert.log
date >> /mnt/ftp/tv/convert.log
/etc/init.d/vdr start
/etc/init.d/vdradmin-am start
Die Variable heißt $VDRFILE und der Inhalt ist z.B:
/mnt/ftp/tv/Verliebt_in_Berlin/_/2006-08-23.19.05.99.99.rec/001.vdr
das ist auch so ok, nun möche ich aber eine Variable haben ($VDROUT) die als Inhalt das hier hat:
/mnt/ftp/tv/Verliebt_in_Berlin/_/2006-08-23.19.05.99.99.rec/001.mpg
also die letzten 3 Zeichen des Strings dur "mpg" ersetzen.
Wie kann ich das machen?
Hier das Script:
#!/bin/sh
date >> /mnt/ftp/tv/convert.log
/etc/init.d/vdr stop
/etc/init.d/vdradmin-am stop
VDRFILE=`find /mnt/ftp/tv -mtime +1 | grep 00..vdr -m 1`
VDROUT=$VDRFILE
nice -20 tovid -in "$VDRFILE" -out "$VDROUT" -pal -half-dvd
echo "VDR Datei bearbeitet $VDRFILE" >> /mnt/ftp/tv/convert.log
rm "$VDRFILE"
echo "QUELLDATEI $VDRFILE geloescht" >> /mnt/ftp/tv/convert.log
date >> /mnt/ftp/tv/convert.log
/etc/init.d/vdr start
/etc/init.d/vdradmin-am start
Zuletzt bearbeitet: