hi,
I have to execute this line below from within a shell script; simply backquoting it is not doing the trick; it is mangling up all the options; but when i type it out on a command line, it executes cleanly. Please help me in getting this right;
As you can see, the syntax of the option specification for VLC includes many complex tokens; Can you guide me to get it working from within backquotes?
I got this partially working by simply writing the line in the shell script (without an backquotes). The problem is my temp.mp4 and file.avi are actually inside variables $T and $F; something like this works:
#!/bin/sh
#do some string manipulation to determine values of $T and $F
What you need to do is pre-process the command line within the single quotes, performing variable substution. I don't know about your application, so here is a trivial example which should make it clear.
There is a one line script called z containing the line "print $1"
There is a variable within the current shell with the value "z" (a=z)
First run z with $a as a parameter and it prints "z" (value substituted)
$ ./z $a
$ z
Next run z with '$a' as a parameter and it prints "$a" (value not substituted because it's in single quotes)
$ ./z '$a'
$ z
Finally, run with eval and value is substuted even though in quotes (substitution is actually done as a separate step before command is executed)
hi all, thanks a lot, I solved the problem with some generous usage of quotes..
vlc -I dummy --sout=""#transcode{vcodec=mp4v,acodec=mp4a}:std{access=file,mux=mp4,url=$T} "" $F
did the trick; the problem was that I needed some kind of quotes after --sout= as part of the commad line syntax;