help-bash
[Top][All Lists]
Advanced

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

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


From: Peng Yu
Subject: Re: Do `>& -` and `<& -` also work?
Date: Mon, 10 May 2021 23:06:40 -0500

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. 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.

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.

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.

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.

-- 
Regards,
Peng



reply via email to

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