如何在shell条件下找到选项 [英] How to find the options in if conditions of shell

查看:94
本文介绍了如何在shell条件下找到选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个shell脚本中,我看到了

In one of my shell script, I'm seeing

if [[ ! -d directory1 || ! -L directory ]] ; then

-d-L选项在这里是什么意思?在哪里可以找到有关在if条件下使用的选项的信息?

What does -d and -L option mean here? Where can I find information about the options to use in an if condition?

推荐答案

您可以执行help test,该操作将显示[[命令接受的大多数选项.

You can do help test which will show most of the options accepted by the [[ command.

您也可以执行help [,这将显示其他信息.您可以执行help [[来获取有关该条件类型的信息.

You can also do help [ which will show additional information. You can do help [[ to get information on that type of conditional.

另请参见"条件表达式中的man bash >"部分.

Also see man bash in the "CONDITIONAL EXPRESSIONS" section.

这篇关于如何在shell条件下找到选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆