From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Feature request: set extension for =( ) created file
Date: Sun, 25 Sep 2016 15:37:06 -0700 [thread overview]
Message-ID: <160925153707.ZM23376@torch.brasslantern.com> (raw)
In-Reply-To: <1769091474822687@web1j.yandex.ru>
On Sep 25, 7:58pm, Nikolay Aleksandrovich Pavlov (ZyX) wrote:
}
} 25.09.2016, 08:19, "Bart Schaefer" <schaefer@brasslantern.com>:
} > The "mktemp" utility is designed to cover nearly all of these cases,
}
} This is an argument against `=()` as a whole, not against my proposal.
Quite the contrary. =() is intended to solve a very specific and very
common case: capture the output of a command and immediately make use
of it, then discard it automatically. It differs from a pipe in only
two very deliberate ways: it provides a file name when a command is
not able to read stdin, and it is seek-able.
There is no corresponding *common* case for any of your suggestions; it
rarely makes sense to create and immediately discard an empty directory,
and it seldom makes sense to create and discard a file with a specific
name.[*] The existence of a more complete solution for complicated
cases neither invalidates the simple solution to the simple case nor
justifies turning the simple solution into a complicated one.
[*] This is not to say that there isn't a use case that might be done
a hundred times in a day that needs a specific name, just that there
are not a large number of different commonly-occuring such use cases.
} > However, neither that nor any of your suggestions would accomplish
} > altering the filename based on the file content.
}
} This feature is not what OP requested.
Nearly everyone seems to have interpreted it that way, even though
Sebastian has now said that's not what he meant ... but:
What's potentially wanted is a syntax that means "take file X, make
a link to it named Y, include Y in the set of files to be unlinked
when this command context is finished, and substitute Y into the
command line in place of X." I simulated that with my "fixfiletype"
precommand-modifier-ish wrapper function. How you generate Y should
not need to have anything to do with where X came from.
The TMPSUFFIX idea is part-way to this, but it still ties Y to X.
It might even be possible to have a TMPFILENAME value that entirely
repaces the mktemp(3) file name, though that wouldn't work if there
are multiple =() on the same command line.
next prev parent reply other threads:[~2016-09-25 22:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-24 17:51 Sebastian Gniazdowski
2016-09-24 17:55 ` Vadim Zeitlin
2016-09-24 18:43 ` Lawrence Velázquez
2016-09-24 19:30 ` Sebastian Gniazdowski
2016-09-24 19:55 ` Lawrence Velázquez
2016-09-24 20:14 ` Sebastian Gniazdowski
2016-09-24 20:36 ` Lawrence Velázquez
2016-09-24 20:44 ` Sebastian Gniazdowski
2016-09-24 21:06 ` Lawrence Velázquez
2016-09-24 21:24 ` Bart Schaefer
2016-09-24 21:58 ` Lawrence Velázquez
2016-09-25 0:05 ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-09-25 5:17 ` Bart Schaefer
2016-09-25 6:17 ` Sebastian Gniazdowski
2016-09-25 15:21 ` Lawrence Velázquez
2016-09-26 18:03 ` Bart Schaefer
2016-09-25 16:58 ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-09-25 22:37 ` Bart Schaefer [this message]
2016-09-24 21:06 ` Bart Schaefer
2016-09-24 18:56 ` Sebastian Gniazdowski
2016-09-24 18:22 ` Bart Schaefer
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=160925153707.ZM23376@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).