I'm trying to use a python script that is executable from the terminal (I'm on OSX). The script is used to convert .mkv to .mp4. From the terminal at the script's directory, all a user has to do is type
Code: Select all
"python script.py -i "file" -o "file.mp4"
. The -i and -o are input and output, respectively. The input file has to be a .mkv for the script to work. I figured that the easiest way to pass these values to this script would be to use a bash script to run that command.
So I wrote a small shell script (called by sabnzbd+) that is one line and is basically the following:
Code: Select all
"python /directory/to/script.py -i $1/*.mkv -o $1/*.mp4"
.Now, the script will run, and it runs the command fine, but it tells me that the input file is not an mkv. This causes it to error out and not go any further. My problem is that I don't know how to pass the value of that .mkv to the bootstrap script to run the command. I thought that "$1" would pass the directory, and the "/*.mkv" would specify the actual .mkv file.
Can anyone tell me what I'm doing wrong? I'm sort of a noob here and I've been stuck for a while on it. Also, I apologize if any of this is confusing, I can try to explain better if required.