Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: '>;' redirection operator
- X-seq: zsh-workers 30044
- From: Thorsten Glaser <tg+ml@xxxxxxxxxx>
- To: Eric Blake <eblake@xxxxxxxxxx>, Bruce Korb <bkorb@xxxxxxx>
- Subject: Re: '>;' redirection operator
- Date: Thu, 22 Dec 2011 23:34:23 +0000 (UTC)
- Cc: David Korn <dgk@xxxxxxxxxxxxxxxx>, austin-group-l@xxxxxxxxxxxxx, Bash - Bug <bug-bash@xxxxxxx>, zsh-workers@xxxxxxx, dash <dash@xxxxxxxxxxxxxxx>, miros-discuss@xxxxxxxxxx
- In-reply-to: <4EF3AA9A.9070009@gnu.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <201112221539.pBMFdlaj011933@penguin.research.att.com> <4EF39B1E.80709@redhat.com> <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author