[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22351: ls doesn't seem to match space in filename
From: |
Paul Eggert |
Subject: |
bug#22351: ls doesn't seem to match space in filename |
Date: |
Mon, 11 Jan 2016 09:28:52 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 01/11/2016 08:56 AM, address@hidden wrote:
For example, if I have the files "foo", "foo1" and "foo bar" in my
directory, a call to
ls foo*
yields only foo and foo1. However, a call to ls "foo "* yields "foo
bar" (sans quotes) as expected.
That's strange, and it's not what I observe on Fedora 23 x86-64 with
Bash 4.3.42(1)-release (x86_64-redhat-linux-gnu):
$ touch foo fool 'foo bar'
$ ls foo*
foo foo bar fool
Most likely this is a bug with your shell, or somewhere else in your
operating system, and not in 'ls' itself. This is because '*' processing
is done by the shell. You can verify this by running strace and looking
at its first line of output. E.g.,:
$ strace ls foo*
execve("/usr/bin/ls", ["ls", "foo", "foo bar", "fool"], [/* 63 vars */]) = 0
...
This says that the kernel invoked "ls" with the arguments "foo" "foo
bar", and "fool".