Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Hi. I'm trying to run the CLI on a some of my video files from a bash script that I'm working on and I can't seem to get it to work correctly. Could someone point me in the right direction? TIA. Below is a sample of some of my attempts to run mediainfo.
mediainfo "--Inform=file://$AUDIO_TEMP $INPUT_FILE > $AUDIO_OUT"
mediainfo --Inform="file://$AUDIO_TEMP $INPUT_FILE > $AUDIO_OUT"
mediainfo --Inform=file://"$AUDIO_TEMP $INPUT_FILE > $AUDIO_OUT"
mediainfo --Inform=file://"$AUDIO_TEMP $INPUT_FILE" > "$AUDIO_OUT"
When I run the command outside of the script with the parameters valued, it runs fine, so my template file and input file don't look like they are the problems.
Please, describe :
1/ Your variables $AUDIO_TEMP, $INPUT_FILE, $AUDIO_OUT
2/ Your Operating System used
I am not an expert of bash, but quotes should be per argument, so I imagine something like:
mediainfo "--Inform=file://$AUDIO_TEMP" "$INPUT_FILE" > "$AUDIO_OUT"
Thanks for the responses.
$AUDIO_TEMP - audio-template.txt, a file in the 'pwd', describing the audio output I need.
$INPUT_FILE - a path to the audio file I wish to run mediainfo on.
$AUDIO_OUT - audio-info.txt, a file I create in the 'pwd', for the audio output.
Running this on Ubuntu 12.04.
Ok, what do you have in your audio-template.txt file ?
I believe that the Jerome answer is what you need...;-)
There is nothing in the file. I create a parameter with the location at the beginning of the script and then have mediainfo write to that location. I then remove the file if the script executes without error.
Thanks I will try the suggestion when I get home.
Cheers. Worked like a charm thanks for the help.