Avi*_*Raj 17 command-line bash
$ type if
if is a shell keyword
Run Code Online (Sandbox Code Playgroud)
我不知道其他 shell 关键字。
是否有任何命令可以列出所有 bash shell 关键字。?
注意:同时help -m显示 shell 内置函数和 shell 关键字。
Rad*_*anu 15
为此存在调用的 shell 内置命令compgen,您在运行时肯定没有注意到它help -m。
$ compgen -k
if
then
else
elif
fi
case
esac
for
select
while
until
do
done
in
function
time
{
}
!
[[
]]
coproc
Run Code Online (Sandbox Code Playgroud)
有关help -m compgen更多信息,请参阅compgen。
从这里采取的想法:
在 bash 中,要列出所有关键字,首先在终端中运行以下命令:
complete -A keyword :
Run Code Online (Sandbox Code Playgroud)然后在提示处输入::SpaceTabTab。
对我来说效果很好:
! { coproc elif fi if then while
[[ } do else for in time
]] case done esac function select until
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5908 次 |
| 最近记录: |