[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] More than one parameters in .mh_profile

From: Ken Hornstein
Subject: Re: [Nmh-workers] More than one parameters in .mh_profile
Date: Mon, 28 May 2012 23:08:59 -0400

>Could nmh not do with such parameters what perl does for
>system()/exec(), auto-splitting the string? In the off
>chance that someone's installed binaries in a path with
>a space they can escape the space, same as they would in
>a shell...

Sure, it COULD do that.  Sounds like you're volunteering to write
the code; great! :-)

In all seriousness ... yeah, that's probably close to an ideal solution,
but it gets complicated quickly in terms of handling quoting (see the
vim example posted earlier).  AFAICT there's no library function to handle
shell-style quoting.

Actually ... I see that what perl does is check for shell metacharacters;
if they exist, then the whole thing gets passed off to "sh -c".
Otherwise it's space-splitted and passed directly to execvp().  You
know ... that's actually not that much code to write and we already
have a space-splitting function (brkstring).  What do people think
of that as a solution?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]