nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] I'm confused

2012-09-14 13:26:28
Hi Norm,

~ cat /t/,a
/home/norm/Downloads/SoundShot.tgz
/home/norm/Downloads/SoundShotA.png
/home/norm/Downloads/SoundShotB1.png
/home/norm/Downloads/SoundShotB2.png
...
==========
What now? attach  $(< /t/,a)
/bin/bash: line 1: /home/norm/Downloads/SoundShotA.png: Permission denied
/bin/bash: line 2: /home/norm/Downloads/SoundShotB1.png: Permission denied
/bin/bash: line 3: /home/norm/Downloads/SoundShotB2.png: Permission denied

Well done, you've found another bug!  :-)

It seems the code is attempting to force $SHELL to expand attach's
parameters and not plain old /bin/sh run by the popen(3) it uses.  So
when I do

    What now? at `seq 1 5`
    ls: cannot access 1: No such file or directory
    /bin/bash: line 1: 2: command not found
    /bin/bash: line 3: 4: command not found
    /bin/bash: line 4: 5: command not found

    What now? 

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.

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>