2015-06-30 14:55:19 +0000, Thorsten Glaser:
> Martijn Dekker dixit:
>
> >'command -v' finds every kind of command except reserved words such as
>
> Hrm, why do people use these things so much which I never use in
> any scripts at all? This, and 'type'b &
>
> >Reference:
>
> >> utilities not associated with a PATH search, and shell reserved
> >> words shall be written as just their names.
>
> Hmpf. Okay. If POSuX says so, despite not even getting the leap second
> right, Ib ll have to change it. Meh.
>
> Can you enumerate the b shell reserved wordsb , so I have an idea what
> to include? (Thinking of && and > and so onb &) This is pure bloat, as
> it will have to be included in another tableb &
[...]
That would be the ones for which "type" (including mksh's type)
give "is a reserved word":
$ mksh -c 'type "for"'
for is a reserved word
$ mksh -c 'type "{"'
{ is a reserved word
&&/> are not reserved words more like operators.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_04
SUS4> ! do esac in
SUS4> { done fi then
SUS4> } elif for until
SUS4> case else if while
[...]
SUS4> The following words may be recognized as reserved words on
SUS4> some implementations (when none of the characters are
SUS4> quoted), causing unspecified results:
SUS4>
SUS4> [[ ]] function select
Cheers,
Stephane