help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do `>& -` and `<& -` also work?


From: Eli Schwartz
Subject: Re: Do `>& -` and `<& -` also work?
Date: Tue, 11 May 2021 00:15:51 -0400

On 5/11/21 12:06 AM, Peng Yu wrote:
> On 5/10/21, Chet Ramey <chet.ramey@case.edu> wrote:
>> On 5/10/21 3:17 PM, Peng Yu wrote:
>>
>>> If verbosity was not an issue, then neither &> nor >& should be
>>> introduced in the first place.
>>>
>>> Since they were introduced, they could be made better to be not
>>> verbose in the cases that I mentioned.
>>
>> You're trying to relitigate 40-year-old decisions. That is, among other
>> things, not productive.
> 
> I totally understand what you are saying. But there are
> POSIX-noncompliant shells that are also very popular. See the
> following shell. It says "fish is ranked 2nd while bash is ranked
> 3rd." I don't know how trustworthy that fish is more popular than
> bash.

The site is highly unreliable. They do many such versus "competitions",
none of them are realistic.

> At least, it should be very popular. So being POSIX-compliant or
> not is not something dictate whether a shell is popular or not. In
> this sense, completely POSIX-compliance is not that important.

Nonsense. The Firefox browser isn't a POSIX-compliant shell, nor is GCC
a POSIX-compliant shell.

Bash is written to be a POSIX-compliant shell, therefore it behooves it
to succeed.

> https://www.slant.co/versus/1601/1602/~bash_vs_fish
> 
> I checked the syntax of fish, which seems to be too far away from the
> bash syntax. I'd rather have something similar to bash but fixing the
> bad designs over the last 40 years. For this reason, it would
> beneficial to evaluate what syntax designs are good and what designs
> are bad in bash (which can come from POSIX). If there were somebody
> who starts with a better shell similar to bash, that could serve as a
> reasonable good starting point.

This is what the fish developers said before creating fish, I believe.
See where it got them.

> For the case of [n]>&word, I doubt most people would add space before
> word. The syntax is just too difficult to be fully understood for
> beginners, most people just copy and paste something that works, which
> is heavily affected by available tutorials. The following is an
> example. In fact, I don't remember I ever seen any tutorials use the
> form with space before word when it is a number or "-". There could be
> spaces when "word" is a filename though.

So don't use it. Even if it is allowed.

> https://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
> 
> In that sense, if the goal is not to be POSIX compatible, but to have
> something as compatible as to existing bash, and getting off those bad
> features that most people don't use anyway, it would be helpful to
> analyze the existing syntax. I hope that you understand the logic
> reasoning here.

Well, but, the goal is to be POSIX compatible. So I'm not sure where
you're going with this discussion.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]