Skip to contentSkip to conversation

No wildcard expansion with redirected filenames

DISCUSSION Alkis Georgopoulos 2 participants 2 messages Aug 7, 2010 – Aug 8, 2010

lore
Share & tools
lore
#0 lore raw

Isn't this supposed to work?

$ touch file1
$ echo 1 > file?
$ ls file? 
file?  file1

I.e. dash actually created a file named 'file?' instead of globbing.

Please CC me if possible, I'm not on the list.

Kind regards,
Alkis Georgopoulos

#1 lore raw
Quoted 8 lines · Alkis Georgopoulos

Isn't this supposed to work?

$ touch file1
$ echo 1 > file?
$ ls file? 
file?  file1

I.e. dash actually created a file named 'file?' instead of globbing.

No, this is not supposed to work. POSIX says that a non-interactive shell must not generate pathnames for a redirection; an interactive shell may do so, provided there is exactly one match.

Dash is primarily meant as a non-interactive shell and wants to be as small as possible, and therefore never generates pathnames for a redirection.

Signature · 1 line
Jilles Tjoelker