Subject: bin/37494: sh doesn't glob input redirect filenames as expected
To: None <firstname.lastname@example.org, email@example.com>
From: None <firstname.lastname@example.org>
Date: 12/06/2007 21:55:01
>Synopsis: /bin/sh doesn't expand * in filenames for input redirection.
>Arrival-Date: Thu Dec 06 21:55:01 +0000 2007
>Release: NetBSD 4.99.38
System: NetBSD netbsd.localdomain 4.99.38 NetBSD 4.99.38 (PUFFS) #1: Sat Dec 1 19:29:09 PST 2007 email@example.com:/home/riz/obj/sys/arch/amd64/compile/PUFFS amd64
Even if a file '/tmp/xyz' exists, "cat </tmp/xyz*" doesn't
redirect input from it:
$ cat < /tmp/xyz*
sh: cannot open /tmp/xyz*: no such file
/bin/ksh and /bin/csh both work as expected, here, and SUSv2 says:
Input redirection will cause the file whose name results from the expansion of word to be opened for reading on the designated file descriptor, or standard input if the file descriptor is not specified.
echo "123" > /tmp/xyz # assume no other filenames in /tmp begin with "xyz"