|Originally posted by lah
... However if I have a script call the command like so:
rtvconvert -d "$i" "dvd/`basename $i .mpg`"
Where $i is the filename string, I get nothing. I even do a ps -x to show me the full command that the script runs and it looks like:
rtvconvert -d "Battlestar Galactica.mpg" "dvd/Battlestar Galactica"
It has the quotes and all and should work. I need to add that I have almost the exact same script for other commands (to serve other functions, obviously) other than rtvconvert and it works flawlessly. Could anyone shed light on how I could get things to work here? If you can confirm that you have the same problem please let me know.
rtvconvert -d "$i" "dvd/`basename \\"$i\\" .mpg`"
This will preserve the $i file name (including embedded spaces) as a single argument passed into basename, which should then do what you want. But if the "ps -x" command you executed shows the filename correctly expanded, I'm perplexed...