nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] I'm confused

2012-09-14 17:42:26
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.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>