shell --判断语言是否能执行

[root@localhost etc]# lls && echo yes || echo no
bash: lls: command not found...
Similar command is: 'ls'
no
[root@localhost etc]# cd /usr/src
[root@localhost src]# ls
debug kernels
[root@localhost src]# ls && echo yes || echo no
debug kernels
yes
[root@localhost src]# lls && echo yes || echo no
bash: lls: command not found...
Similar command is: 'ls'
no
[root@localhost src]#

 

posted @ 2020-10-26 20:32  正霜霜儿  阅读(129)  评论(0编辑  收藏  举报