[MPlayer-dev-eng] run command patch
Diego Biurrun
diego at biurrun.de
Wed Feb 22 20:42:34 CET 2012
On Wed, Feb 22, 2012 at 05:56:21PM +0100, Reimar Döffinger wrote:
> 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?
I would guess that ${non_existing_var} is expanded to nothing, what is
expanded to some sensible value? I don't remember us having this
documented anywhere...
Diego
More information about the MPlayer-dev-eng
mailing list