[MPlayer-dev-eng] run command patch

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Feb 22 17:56:21 CET 2012


On Tue, Feb 21, 2012 at 11:06:00PM +0100, Diego Biurrun wrote:
> On Wed, Feb 15, 2012 at 08:31:09PM +0100, Reimar Döffinger wrote:
> > On Wed, Feb 15, 2012 at 08:16:52PM +0100, Jan Christoph Uhde wrote:
> > > --- DOCS/tech/slave.txt	(revision 34728)
> > > +++ DOCS/tech/slave.txt	(working copy)
> > > @@ -508,11 +508,21 @@
> > >  
> > > -run <value>
> > > -    Run <value> as shell command. In OSD menu console mode stdout and stdin
> > > -    are through the video output driver.
> > > +run <string>
> > > +    Run <string> with expanded variables as shell command. In OSD menu
> > > +    console mode stdout and stdin are through the video output driver.
> > >  
> > > +    Example:
> > > +    <KEY> run "echo '${filename} ${stream_pos}' >> <path_to_file>"
> > >  
> > > +    A POSIX shell would not be able to expand the variables between
> > > +    single quotes. So it should be obvious that ${<var_name>} strings are
> > > +    not shell variables. The syntax with curly braces for shell variables
> > > +    can not be used. Because the variable is either expanded to one
> > > +    of MPlayer's properties or a string of length zero before the
> > > +    command is passed to /bin/sh.
> > 
> > Ah.
> > Maybe more clear:
> > Note: MPlayer will do variable expansion on anything of the form
> > ${somevar} before it is passed to the shell.
> > This means that you cannot use this syntax for anything you actually
> > want the shell to handle.
> > Anything else will be passed on to the shell unchanged, so you can
> > use e.g. $somevar to have the shell expand it instead of MPlayer.
> 
> But what does MPlayer expand?

What do you mean? The first sentence says "anything of the form
${somevar}".
Or do you mean what it expands it to?
That hopefully is already explained somewhere since that's not new
code, it probably should be referenced though.


More information about the MPlayer-dev-eng mailing list