public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* #!/bin/sh vs #!/bin/bash filename expansion after <
@ 2020-08-12 17:54 Morten Kjærulff
  2020-08-12 18:24 ` Eliot Moss
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Morten Kjærulff @ 2020-08-12 17:54 UTC (permalink / raw)
  To: cygwin

Hi,

This script:

#!/bin/sh
echo hello >hello.txt
ls -l
cat hell*
cat < hell*

gives me:

$ ./t.sh
total 2
-rw-r--r-- 1 vp01mkf Domain Users  6 Aug 12 19:51 hello.txt
-rwxr-xr-x 1 vp01mkf Domain Users 60 Aug 12 19:51 t.sh
hello
./t.sh: line 5: hell*: No such file or directory

But if I change line1 to
#!/bin/bash
I get
hello
hello

Is that correct behaviour. I guess so, but why? And what is the rule?

/Morten

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-12 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 17:54 #!/bin/sh vs #!/bin/bash filename expansion after < Morten Kjærulff
2020-08-12 18:24 ` Eliot Moss
2020-08-12 20:07 ` Andrey Repin
2020-08-12 20:53   ` Eliot Moss
2020-08-12 21:07 ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).