All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Glaser <tg+ml-SdpXnpOQhD8dnm+yROfE0A@public.gmane.org>
To: Eric Blake <eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Bruce Korb <bkorb-mXXj517/zsQ@public.gmane.org>
Cc: David Korn <dgk-7WuBAv+fczCkVZkbZjKZZw@public.gmane.org>,
	austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org,
	Bash - Bug <bug-bash-mXXj517/zsQ@public.gmane.org>,
	zsh-workers-SwHCXuVDQaU@public.gmane.org,
	dash <dash-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	miros-discuss-SdpXnpOQhD8dnm+yROfE0A@public.gmane.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-mXXj517/zsQ@public.gmane.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

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

Thread overview: 4+ 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
     [not found]     ` <4EF3AA9A.9070009-mXXj517/zsQ@public.gmane.org>
2011-12-22 23:34       ` Thorsten Glaser [this message]
2011-12-23  0:14     ` Geir Hauge

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-sdpxnpoqhd8dnm+yrofe0a@public.gmane.org \
    --cc=austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org \
    --cc=bkorb-mXXj517/zsQ@public.gmane.org \
    --cc=bug-bash-mXXj517/zsQ@public.gmane.org \
    --cc=dash-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dgk-7WuBAv+fczCkVZkbZjKZZw@public.gmane.org \
    --cc=eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=miros-discuss-SdpXnpOQhD8dnm+yROfE0A@public.gmane.org \
    --cc=zsh-workers-SwHCXuVDQaU@public.gmane.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.