Date:        Fri, 22 Jul 2022 07:58:47 -0500
    From:        "Eric Blake via austin-group-l at The Open Group" 
<austin-group-l@opengroup.org>
    Message-ID:  <20220722125847.tidcrt7a6ntvy...@redhat.com>


  | [If readlink is implemented as a shell builtin, then you could have an
  | extension where:
  |
  |   readlink -v var -n -- "$name"

If something like that were implemented, the -n would be a waste of
space (there) the variable would always be assigned the value of the
symlink, the -n is only to suppress the \n that is printed after that
when writing it to stdout.

The uses in cmdsubs you dissected are clearly not what -n is intended
for (though I wonder if perhaps something similar in csh, if that
ability is there - it has been so long since I looked at that - might
have a different outcome).

Aside from that possibility the only reason would seem to be the same
as why echo (real ones) have -n (and trashy ones have \c) and why
printf(1) needs a \n to print one ... there are times that it is useful
to write a partial line to stdout (or wherever) and there's no reason
that the output of readlink could not be intended to be a part of such
a gradually constructed output line.

kre

              • ... Jonathan Wakely via austin-group-l at The Open Group
              • ... G. Branden Robinson via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
    • Re: [10... Robert Elz via austin-group-l at The Open Group
      • Re:... Thorsten Glaser via austin-group-l at The Open Group
      • Re:... Robert Elz via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
    • Re: [10... Quentin Rameau via austin-group-l at The Open Group
      • Re:... Eric Blake via austin-group-l at The Open Group
      • Re:... Robert Elz via austin-group-l at The Open Group
        • ... Jonathan Wakely via austin-group-l at The Open Group
          • ... Eric Blake via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to