Re: FVWM: Re: [HELP]PipeRead Strange Error Message

From: <liushidai_at_mails.tsinghua.edu.cn>
Date: Mon, 17 May 2004 11:55:40 +0800

In your mail:
>From: Mikhael Goikhman <migo_at_homemail.com>
>Reply-To:
>To: liushidai_at_mails.tsinghua.edu.cn
>Subject: Re: FVWM: Re: [HELP]PipeRead Strange Error Message
>
>On 16 May 2004 23:06:47 -0400, Parv wrote:
> >
> > in message <284684067.01253_at_mails.tsinghua.edu.cn>,
> > wrote liushidai_at_mails.tsinghua.edu.cn thusly...
> > >
> > > + I PipeRead `ps x|grep Fvwm|sed -e
> > > "s/\\(.*\\)\\/\\(Fvwm[a-zA-Z]\\+\\).*/AddToMenu ModuleList \\2 KillModule
> > > \\2/"|sort|uniq`
> > >
> > > However, the PipeRead command stream is rendered as:
> > > ``28876 ? R 0:00 sh -c ps x|grep Fvwm|sed -e
> > > "s/\(.*\)\/\(Fvwm[a-zA-Z]\+\).*/AddToMenu ModuleList \2 KillModule
> > > \2/"|sort|uniq"
> >
> > Notice that you are using ``, to execute a command in subshell
> > instead of '' which may or may not matter to fvwm. Try with '' or ""
> > instead of `` in any case.
>
> Parv, why not just open FvwmConsole and verify your (wrong) theory? :)
>
> Ok, let's analyze the situation. Suppose we all have GNU tools and this
> command (pasted from the top of this message) indeed generates the menu:
>
> % ps x|grep Fvwm|sed -e "s/\\(.*\\)\\/\\(Fvwm[a-zA-Z]\\+\\).*/AddToMenu
ModuleList \\2 KillModule \\2/"|sort|uniq
>
> First, the choice of double quotes cause you double backslashes,
> this is needless. Rewrite this shell command using a single quote:
>
> % ps x|grep Fvwm|sed -e 's/\(.*\)\/\(Fvwm[a-zA-Z]\+\).*/AddToMenu ModuleList
\2 KillModule \2/'|sort|uniq
>
> Now, you have 2 choices. First, to try to insert one of these commands
> into PipeRead. To do this, you should escape all backslash using another
> backspace (or maybe even replace each backslash with 4 backspaces, yes).
> Dollars should sometimes be escaped too. You may play with it until you
> get it correctly.
>
> Another (preferable) choice is to create ~/bin/fvwm-menu-mymodulelist
> script that contains our single line and just call it:
>
> + I PipeRead `fvwm-menu-mymodulelist`
>
> Regards,
> Mikhael.
>
Great tips!
But:
AddToFunc funcModuleList
 + I PipeRead `ps x|grep Fvwm|sed -e 's!\\(.*\\)/\\(Fvwm[a-zA-Z]\\+\\).*!AddToMenu
ModuleList \\2 KillModule \\2!'|sort -u`
already works in the popup menu.
I am just confused by the error messages in ~/.xsession-errors:
[FVWM][__execute_function]: <<ERROR>> No such command '15958'

Then I try starting 'fvwm -D' for debugging and know that
'`ps x|grep Fvwm|sed -e 's!\\(.*\\)/\\(Fvwm[a-zA-Z]\\+\\).*!AddToMenu ModuleList
\\2 KillModule \\2!'|sort -u`'
is rendered by fvwm as:
'15958 ? R 0:00 sh -c ps x|grep Fvwm|sed -e
's!\(.*\)/\(Fvwm[a-zA-Z]\+\).*!AddToMenu ModuleList \2 KillModule \2!'|sort -u'

BTW: I am using fvwm-snap-20040516


--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun May 16 2004 - 23:03:07 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST