Friday, May 3, 2024
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 7366  / 2 Years ago, thu, december 2, 2021, 4:53:30
$ type if
if is a shell keyword


I don't know the other shell keywords.



Is there any command
to list all the bash shell keywords.?



Note: help -m displays both shell builtins and shell keywords.


More From » command-line

 Answers
1

For this exists that shell builtin command called compgen which most certainly you did not notice it when you run help -m.



$ compgen -k
if
then
else
elif
fi
case
esac
for
select
while
until
do
done
in
function
time
{
}
!
[[
]]
coproc


See help -m compgen for more info about compgen.


[#26104] Thursday, December 2, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teromato

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
1 Year ago
;