[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Redoing argument processing
From: |
Paul Fox |
Subject: |
Re: [Nmh-workers] Redoing argument processing |
Date: |
Fri, 18 Jan 2013 08:43:02 -0500 |
oliver wrote:
> You wrote:
> >
> > /bin/sh -c 'proc "$@"' dummyarg arg1 arg2 arg3
> >
> > What do others think about this? Anything I'm missing?
>
...
>
> > - If "proc" has no spaces or shell metacharacters, treat normally.
> > - If "proc" has spaces in it, space-split it and have each word put into
> > it's own index in the argv[] array.
> > - If "proc" contains shell metacharacters, send it to /bin/sh -c
>
> I'd be tempted to be lazy and not bother with the middle one of those.
> You have to think about tabs and newlines, not just spaces.
couldn't one just skip the whole "what's a shell metacharacter these days?"
issue, and just always go for door #3?
paul
>
> What would you do about trailing whitespace? It probably shouldn't count
> for selecting the second option instead of the first and should just be
> stripped.
>
> Oliver
>
=---------------------
paul fox, address@hidden (arlington, ma, where it's 13.6 degrees)
- Re: [Nmh-workers] Redoing argument processing, (continued)
Re: [Nmh-workers] Redoing argument processing, Ralph Corderoy, 2013/01/17
Re: [Nmh-workers] Redoing argument processing, Paul Fox, 2013/01/17
Re: [Nmh-workers] Redoing argument processing, Oliver Kiddle, 2013/01/18
Re: [Nmh-workers] Redoing argument processing, Ken Hornstein, 2013/01/18