Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: spaces in filenames should be a crime.



On 28/03/17 09:10 AM, Daniel Shahaf wrote:
Ray Andrews wrote on Tue, Mar 28, 2017 at 07:29:24 -0700:
ls is a passive recipient, there is no 'request'.  Yes?
Yes:

      1	% strace -fe execve sh -c 'ls -d /*'
      2	execve("/bin/sh", ["sh", "-c", "ls -d /*"], [/* 47 vars */]) = 0
      3	Process 8717 attached
      4	[pid  8717] execve("/bin/ls", ["ls", "-d", "/bin", "/boot", "/dev", "/etc", "/home", "/initrd.img", "/lib", "/lib64", "/lost+found", "/media", "/mnt", ...], [/* 47 vars */]) = 0

That execve() line shows the 'argv' array in ls's main() will be.  You
can see that it has no asterisks.

It must be frustrating for the list that after several years I still make these DOSy mistakes. The above code is most educational, thanks.



Messages sorted by: Reverse Date, Date, Thread, Author