zsh-workers
 help / color / mirror / code / Atom feed
From: Thorsten Glaser <tg+ml@mirbsd.org>
To: Eric Blake <eblake@redhat.com>, Bruce Korb <bkorb@gnu.org>
Cc: David Korn <dgk@research.att.com>,
	austin-group-l@opengroup.org, Bash - Bug <bug-bash@gnu.org>,
	zsh-workers@zsh.org, dash <dash@vger.kernel.org>,
	miros-discuss@mirbsd.org
Subject: Re: '>;' redirection operator
Date: Thu, 22 Dec 2011 23:34:23 +0000 (UTC)	[thread overview]
Message-ID: <Pine.BSM.4.64L.1112222327530.2211@herc.mirbsd.org> (raw)
In-Reply-To: <4EF3AA9A.9070009@gnu.org>

Eric Blake dixit:

>powerful approach.  Can we get buy-in from other shell developers to
>support '>;' as an atomic temp-file replacement-on-success idiom, if

Urgh, PLEASE NOT!

People complain about the readability of code enough already, and as
practice shows, things like [[ have been around and nobody uses them
anyway (often using just POSIX, but not even knowing – myself included
– that POSIX sh has $((…))⁺; or even using less-than-POSIX, e.g. in
autoconf, which means that anything we were to introduce now would not
be used in the places where it counts anyway, for compatibility).

⁺) Reminds me to write to the list about that. Buried in dayjob work
   atm though. Expect something about that next year.


Bruce Korb dixit:

> slide on slippery slopes.  Shells can always add some useful builtins:
>
>   sh_move_if_changed
>   sh_save_on_success
>   sh_save_on_failure

In mksh, practice is to keep such things out of the core code and
optionally put it into ~/.mkshrc instead. The pushd/popd/dirs code
is a prime example of it. Also, this way, the shell is extended in
shell instead of in C. (I’ve seen the C201x draft this week. This
drives home _that_ point even better. That’s bloat, not C any more.)

Many languages have standard libraries written in that language
itself, for better portability and easier maintenance, so I’d say
do it like that. Heck, https://evolvis.org/projects/shellsnippets/
(disclaimer: a pet project of a coworker and me) is waiting for
more contributions. (Hosted at my current employer, that’s why I
untypically-for-me chose git so nobody needs to fear they could
take it down.)


Oh, and: sed. has. no. -i. option. either. Please. There’s a
perfectly fine ed, man! man ed! for that.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh


  reply	other threads:[~2011-12-22 23:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201112221539.pBMFdlaj011933@penguin.research.att.com>
2011-12-22 21:03 ` '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)] Eric Blake
2011-12-22 22:09   ` Bruce Korb
2011-12-22 23:34     ` Thorsten Glaser [this message]
2011-12-23  0:14     ` Geir Hauge
2001-06-03 20:10 <> redirection operator Clint Adams
2001-06-03 20:49 ` Bart Schaefer
2001-06-03 21:00   ` Clint Adams
2001-06-03 23:14     ` Peter Stephenson
2001-06-03 23:06       ` 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=Pine.BSM.4.64L.1112222327530.2211@herc.mirbsd.org \
    --to=tg+ml@mirbsd.org \
    --cc=austin-group-l@opengroup.org \
    --cc=bkorb@gnu.org \
    --cc=bug-bash@gnu.org \
    --cc=dash@vger.kernel.org \
    --cc=dgk@research.att.com \
    --cc=eblake@redhat.com \
    --cc=miros-discuss@mirbsd.org \
    --cc=zsh-workers@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).