[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] I'm confused
From: |
David Levine |
Subject: |
Re: [Nmh-workers] I'm confused |
Date: |
Fri, 14 Sep 2012 13:44:59 -0500 |
Ralph wrote:
> 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.
Again, the problem is the new lines introduced by `seq 1 5`.
With bash, this works just fine:
What now? at {1..5}
I'd keep it simple for now rather than trying to add on to the
mess that's there.
David
Re: [Nmh-workers] I'm confused, Lyndon Nerenberg, 2012/09/14
Re: [Nmh-workers] I'm confused, David Levine, 2012/09/13
Re: [Nmh-workers] I'm confused, David Levine, 2012/09/14
Re: [Nmh-workers] I'm confused,
David Levine <=
Re: [Nmh-workers] I'm confused, Jon Steinhart, 2012/09/14
Re: [Nmh-workers] I'm confused, David Levine, 2012/09/14