[MPlayer-dev-eng] run command patch

Diego Biurrun diego at biurrun.de
Tue Feb 21 23:00:51 CET 2012


On Wed, Feb 15, 2012 at 08:16:52PM +0100, Jan Christoph Uhde wrote:
> On 2012-02-15 19:28, Reimar Döffinger wrote:
> > On 15 Feb 2012, at 19:16, Jan Christoph Uhde <Jan at UhdeJc.com> wrote:
> >> On 2012-02-14 21:49, compn wrote:
> >>>>
> >>>> It should work with any shell that supports "echo" and ">>",
> >>>> I think that includes even Windows cmd.exe, so yes, I
> >>>
> >>> except for "~/interesting" not working in cmd.exe.
> >>> echo and >> do work on cmd.exe.
> >>>
> >>> you could just add another line how to do it on windows if anyone cares
> >>> about it.
> >>
> >> people who read this file will know how ~ expands on *nix and that they
> >> must use %USER%, %HOME% or whar ever on windows:)
> > 
> > Well, you could just leave the path out and it should work fine anywhere, even if it is slightly less useful as-is.
> > Though I think the command tries to run sh anyway, so I think that feature does not work at all on Windows currently.
> > At the same time, /bin/sh is almost certainly a POSIX shell, so the command should indeed always work.
> > But either way the main point was that it was completely unclear what that sentence was supposed to mean, and we definitely shouldn't have that in the documentation.
> 
> Hopefully you understand now better what i was trying to say:)

Not really ...

> --- 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.

Nothing is obvious here.  If the single quotes arrive at the shell or
not is anyone's guess.  Maybe it's clear to you, but surely not to a
person reading this document.

All the asides about POSIX shells are confusing.  Just say who gets to
expand what and which syntax is the correct one for MPlayer-expanded and
shell-expanded variables.

Diego


More information about the MPlayer-dev-eng mailing list