I am trying to create a script that runs an another script and changes the name from the output.
Here is the script so far:
#! /bin/bash
i=1
for N in mediainput.iso mediainput2.iso
do
x264transcode $N
mv $N $((i++))
done
This don`t that well. It just moves the files and renames them.
I need to first run the x264transcode and then rename the output of that. Since they all get the same name when x264transcode as processed the files.
Its okey that the name the files are changed to are 1 then 2 and so on.
But it would be a plus if there where a method of getting the name of the folder the file was inside or the file itself. Maybe choosing between them for different scenarios.
Example below:
- ~/Videos/Summer Vacation 2009/dvd.iso
- Output from x264: VIDEO01.mkv
- Output from rename script: Summer-Vacation-2009.mkv
x264transcode $Nso this willbex264transcode mediainput.isoafter the first variable substitution.mv $N $((i++))will then mv/rename the input file. Is your inputfilename the output filename? But then, it isn't the same name for every file. You too are talking about folders. Butmediainput.isodoesn't look as a foldername either. Am I getting something wrong?