[Top][All Lists]

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

Re: [Nmh-workers] I'm confused

From: Jon Steinhart
Subject: Re: [Nmh-workers] I'm confused
Date: Fri, 14 Sep 2012 11:46:15 -0700

Ken Hornstein writes:
> >what's happening is
> >
> >    execve("/bin/sh",
> >        ["sh", "-c", "$SHELL -c \" cd /tmp;ls `seq 1 5`\""], ...) = 0
> Yeah, I was actually thinking to myself when looking at that code, "Hey,
> doesn't our popen() use sh -c?"
> I look at this and I can't help thinking that's the wrong answer; getting
> shell quoting is hard enough, but having to double-quote it?  That just
> seems like a mistake to me.  Also, depending on "ls" output to get a list
> of files seems like that's fraught with problems as well.  I suspect that's
> why Norm is getting a blank Nmh-Attachment header; there's a blank line
> being output somewhere by his version of ls.
> I have an alternative suggestion: we ditch this code entirely and
> go to using glob(3).  I mean, that's 90% of what people really want
> anyway, right?  Expecting full-level shell interpretation at the
> WhatNow? prompt just seems wrong.  Also, since the attach command
> is actually implemented using anno(1) functions, it seems like we
> should make a real "attach" command that can be used from the shell.
> That would just call the right anno function, of course.
> --Ken

OK, well, this stuff did fine for years.  Guess those shortcut hacks are
coming back to haunt me.

glob won't work because it doesn't do tilde expansion but wordexp does.
Having a real attach command would give Norm a place for documentation.


reply via email to

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