nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] I'm confused


From: Ralph Corderoy
Subject: Re: [Nmh-workers] I'm confused
Date: Fri, 14 Sep 2012 23:42:08 +0100

Hi David,

> > what's happening is
> >
> >     execve("/bin/sh",
> >         ["sh", "-c", "$SHELL -c \" cd /tmp;ls `seq 1 5`\""], ...) = 0
> >     execve("/usr/bin/seq",
> >         ["seq", "1", "5"], ...) = 0
> >     execve("/bin/bash",
> >         ["/bin/bash", "-c", " cd /tmp;ls 1\n2\n3\n4\n5"], ...) = 0
> >     execve("/bin/ls",
> >         ["ls", "1"], ...) = 0
> >
> > and bash then goes on to try and run `2', `3', ...  It's undergoing
> > double interpretation.
> >
> > Hopefully this is clear enough for Ken et al;  sorry, under time
> > pressure at the moment.
> 
> Again, the problem is the new lines introduced by `seq 1 5`.

That's true, but it isn't bash's fault.  If my $SHELL was sh the same
result would occur.  The problem is the double evaluation that's going
on.

> With bash, this works just fine:
> 
>   What now? at {1..5}

Yes, because braces expand to space-separated rather than the
\n-terminated of ls(1), as you pointed out.

Cheers, Ralph.



reply via email to

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