Linux Shell 中if的[-e,-d,-f]

文件比较运算符

  • -e filename 如果 filename存在,则为真 [ -e /var/log/syslog ]
  • -d filename 如果 filename为目录,则为真 [ -d /tmp/mydir ]
  • -f filename 如果 filename为常规文件,则为真 [ -f /usr/bin/grep ]
  • -L filename 如果 filename为符号链接,则为真 [ -L /usr/bin/grep ]
  • -r filename 如果 filename可读,则为真 [ -r /var/log/syslog ]
  • -w filename 如果 filename可写,则为真 [ -w /var/mytmp.txt ]
  • -x filename 如果 filename可执行,则为真 [ -L /usr/bin/grep
  • filename1 -nt filename2 如果 filename1比 filename2新,则为真 [ /tmp/install/etc/services -nt /etc/services ]
  • filename1 -ot filename2 如果 filename1比 filename2旧,则为真 [ /boot/bzImage -ot arch/i386/boot/bzImage ]
  • -h filename 如果filename是软链接,则为真

字符串比较运算符 (请注意引号的使用,这是防止空格扰乱代码的好方法)

  • -z string 如果 string长度为零,则为真 [ -z "$myvar" ]
  • -n string 如果 string长度非零,则为真 [ -n "$myvar" ]
  • string1 = string2 如果 string1与 string2相同,则为真 [ "$myvar" = "one two three" ]
  • string1 != string2 如果 string1与 string2不同,则为真 [ "$myvar" != "one two three" ]

算术比较运算符

  • num1 -eq num2 等于 [ 3 -eq $mynum ]
  • num1 -ne num2 不等于 [ 3 -ne $mynum ]
  • num1 -lt num2 小于 [ 3 -lt $mynum ]
  • num1 -le num2 小于或等于 [ 3 -le $mynum ]
  • num1 -gt num2 大于 [ 3 -gt $mynum ]
  • num1 -ge num2 大于或等于 [ 3 -ge $mynum ]

布尔运算符

  • 逻辑非!     if [ ! 表达式 ]
  • 逻辑与 –a   if [ 表达式1  –a  表达式2 ]
  • 逻辑或 -o    if [ 表达式1  –o 表达式2 ]

逻辑运算符

  • && :逻辑的 AND
  • || :逻辑的 OR 

原文链接: linux shell 指令 诸如-d, -f, -e之类的判断表达式_百度知道

  • 2
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MSR Identity Toolbox: A Matlab Toolbox for Speaker Recognition Research Version 1.0 Seyed Omid Sadjadi, Malcolm Slaney, and Larry Heck Microsoft Research, Conversational Systems Research Center (CSRC) [email protected], {mslaney,larry.heck}@microsoft.com This report serves as a user manual for the tools available in the Microsoft Research (MSR) Identity Toolbox. This toolbox contains a collection of Matlab tools and routines that can be used for research and development in speaker recognition. It provides researchers with a test bed for developing new front-end and back-end techniques, allowing replicable evaluation of new advancements. It will also help newcomers in the field by lowering the “barrier to entry”, enabling them to quickly build baseline systems for their experiments. Although the focus of this toolbox is on speaker recognition, it can also be used for other speech related applications such as language, dialect and accent identification. In recent years, the design of robust and effective speaker recognition algorithms has attracted significant research effort from academic and commercial institutions. Speaker recognition has evolved substantially over the past 40 years; from discrete vector quantization (VQ) based systems to adapted Gaussian mixture model (GMM) solutions, and more recently to factor analysis based Eigenvoice (i-vector) frameworks. The Identity Toolbox provides tools that implement both the conventional GMM-UBM and state-of-the-art i-vector based speaker recognition strategies. A speaker recognition system includes two primary components: a front-end and a back-end. The front-end transforms acoustic waveforms into more compact and less redundant representations called acoustic features. Cepstral features are most often used for speaker recognition. It is practical to only retain the high signal-to-noise ratio (SNR) regions of the waveform, therefore there is also a need for a speech activity detector (SAD) in the fr

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值