public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Morten Kjærulff" <mortenkjarulff@gmail.com>
To: cygwin@cygwin.com
Subject: #!/bin/sh vs #!/bin/bash filename expansion after <
Date: Wed, 12 Aug 2020 19:54:05 +0200	[thread overview]
Message-ID: <CA+7cx1rLR-s9vEu587aUycQ6GqNBLTYaeXL4Q7Ff6GNAJ4pNow@mail.gmail.com> (raw)

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

             reply	other threads:[~2020-08-12 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 17:54 Morten Kjærulff [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+7cx1rLR-s9vEu587aUycQ6GqNBLTYaeXL4Q7Ff6GNAJ4pNow@mail.gmail.com \
    --to=mortenkjarulff@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).