Source-Changes-D archive

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

Re: CVS commit: src/bin/sh



    Date:        Thu, 15 Mar 2018 01:20:43 +0000
    From:        "Valeriy E. Ushakov" <uwe%netbsd.org@localhost>
    Message-ID:  <20180315012043.C3D92FB40%cvs.NetBSD.org@localhost>

  | The manual is still rather inconsistent e.g. when referring to
  | parameters where it randomly uses both $0 and 0 or $@ and @ - but I'm
  | not shaving that yak at least for now.

Please be careful if you get cold, and decide you need the wool.

I have just done a brief scan (of the @ uses at least) and I think
at least most of them are correct as they are (at least, I did not
see any that are not - but I did not look carefully at every one.)

The man page uses just "@" when it is referring to the name of
the special parameter, and "$@" when it is referring to the results
of expanding that special paramater, so it is correct to say

	$@ expands to ...
but would not be to say
	@ expands to
as @ doesn't expand to anything, it is just a character.

Similarly,
	the special parameter @ gives a list of ...
(or "expands to ...") is correct,. but
	the special parameter $@ gives ...
would not be, as $@ is not a special parameter (or
not normally.)

$0 is also the expansion of the special parameter 0,
it would have the same usage rules (though I did not
look for that one - there are far more 0's in the man page
than @'s!)

kre



Home | Main Index | Thread Index | Old Index