On 21/09/2025 at 13:37, Greg Wooledge wrote:
On Sun, Sep 21, 2025 at 13:04:59 +0200, pourko--- via Bug reports for the GNU 
Bourne Again SHell wrote:
On Sat, 20 Sep 2025 15:57:08 -0400 Greg Wooledge wrote:
I have two -- no, three -- no, four -- issues with this function:

   1) It's overriding the seq(1) command on systems which have one, with
      a less capable alternative.
   2) It's "off by one" if you provide two sensible inputs.  This is the
      issue that I believe prompted this entire thread.
   3) If the inputs are equal, then based on the above, you would expect
      it to give two numbers as output.  But because of the "if" check,
      it gives none.
   4) It uses echo -n instead of printf.  echo is not reliable.

Greg, I completely agree about your points 2), 3), and 4).
I was merely making a point about your 1):

Shadowing a command with a function is not necessarily an "issue"
if an author desires to do so in a certain script. This is an example.

Sure, except this isn't a script.  It's in a file named Bash_aliases
contained in a directory named examples/startup-files.  It was clearly
intended to be copied into one's ~/.bashrc file (or to be dotted in
from there).

Including it in your ~/.bashrc would effectively mask the real seq(1)
command in all of your interactive shells.  A naive user might not even
understand that this is happening.



IMHO a naïve user wouldn't know about examples/startup-files in the bash source tree. In my case even a relatively sophisticated user didn't know about it. Bad examples should be excised. I think general /etc/[bash[_.]*|profile] and /etc/skel/ file suggestions should be left to the distro maintainers.

--
Chris Elvidge
England


Reply via email to