From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: whence question
Date: Sat, 14 Jan 2017 20:13:19 +0000 [thread overview]
Message-ID: <20170114201319.GA6210@fujitsu.shahaf.local2> (raw)
In-Reply-To: <6237271484420924@web15h.yandex.ru>
Nikolay Aleksandrovich Pavlov (ZyX) wrote on Sat, Jan 14, 2017 at 22:08:44 +0300:
> \* E.g. when you issue `vim *.foo` you most likely do not want to
> open `*.foo` file if you happen to spell glob wrong or `tar cf foo.tar
> *.foo` will create empty archive if glob is spelled wrong and it
> received unexistent file as an argument.
Semantically, the glob «*.foo» and the literal filename «'*.foo'» would
be different types, if the shell language were strongly typed. The
former would be a function that returns a list of words and the
latter would be (is) a word.
You could in principle define a pattern matching flavour where the
regexp /αλφα/ matches the plaintext «alfa», and then — let's assume for
the moment that all your filenames are ASCII — the commands
.
% ls αλφα
% ls alfa
.
would very clearly be different: one of them has a glob argument and one
of them has a literal string argument.
Now, the shell language is _not_ strongly typed, but nonetheless, when
people write «*.foo» intending a pattern that expands to one or more
filenames, it usually doesn't make sense to just use the pattern
instead — not any more than it would be logical for
.
% echo αλφα > list-of-important-files.txt
.
to dump the Greek into the .txt file, in the example where all filenames
were ASCII.
Cheers,
Daniel
next prev parent reply other threads:[~2017-01-14 20:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-14 4:13 Ray Andrews
2017-01-14 5:11 ` Bart Schaefer
2017-01-14 6:09 ` Ray Andrews
[not found] ` <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca>
2017-01-14 6:48 ` Daniel Shahaf
2017-01-14 16:36 ` Ray Andrews
2017-01-14 17:11 ` Bart Schaefer
2017-01-14 19:13 ` Ray Andrews
2017-01-14 17:46 ` Jens Elkner
2017-01-14 17:59 ` Bart Schaefer
2017-01-14 18:23 ` Jens Elkner
2017-01-14 19:08 ` Nikolay Aleksandrovich Pavlov (ZyX)
2017-01-14 20:13 ` Daniel Shahaf [this message]
2017-01-14 21:04 ` Bart Schaefer
[not found] ` <4cca17742cded21984e6092622265ab9@cmgw03.eastlink.ca>
2017-01-14 21:44 ` Ray Andrews
[not found] <652bcc3f-7365-2e52-d39c-8576278606bc__74.9235078275845$1484367323$gmane$org@eastlink.ca>
2017-01-14 4:40 ` Daniel Shahaf
2017-01-14 4:57 ` Ray Andrews
2017-01-14 18:32 ` Ray Andrews
2017-01-14 18:55 ` Bart Schaefer
2017-01-14 19:51 ` Ray Andrews
2017-01-14 20:56 ` Daniel Shahaf
2017-01-14 21:26 ` Ray Andrews
2017-01-14 21:53 ` Daniel Shahaf
2017-01-15 19:53 ` Ray Andrews
2017-01-14 21:43 ` Bart Schaefer
2017-01-14 21:55 ` Bart Schaefer
2017-01-15 20:06 ` Ray Andrews
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=20170114201319.GA6210@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-users@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).