免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3460 | 回复: 3
打印 上一主题 下一主题

新手求助:关于if中使用的-M参数,知道的帮助一下 [复制链接]

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-09-16 13:55 |只看该作者 |倒序浏览
if ($origin ne "addfdjkklj" or  (-M $full_path < 180) )

请问-M参数是什么作用的?

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
2 [报告]
发表于 2013-09-16 14:00 |只看该作者
不好意思刚刚找到答案了,嘿嘿,不知道理解对不对:

-M是文件测试操作符,得到距离上次修改多长时间

论坛徽章:
145
技术图书徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11狮子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龙
日期:2014-01-08 15:26:12技术图书徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
3 [报告]
发表于 2013-09-16 14:42 |只看该作者
回复 1# qq27898

$ perldoc -f -X

       -X FILEHANDLE
       -X EXPR
       -X      A file test, where X is one of the letters listed below.  This unary
               operator takes one argument, either a filename or a filehandle, and
               tests the associated file to see if something is true about it.  If
               the argument is omitted, tests $_, except for "-t", which tests STDIN.
               Unless otherwise documented, it returns 1 for true and ’’ for false,
               or the undefined value if the file doesn’t exist.  Despite the funny
               names, precedence is the same as any other named unary operator, and
               the argument may be parenthesized like any other unary operator.  The
               operator may be any of:

                   -r  File is readable by effective uid/gid.
                   -w  File is writable by effective uid/gid.
                   -x  File is executable by effective uid/gid.
                   -o  File is owned by effective uid.
                   ....

                   -M  Script start time minus file modification time, in days.

                   ....

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
4 [报告]
发表于 2013-09-16 14:43 |只看该作者
回复 3# jason680


    给力呀,我这里没有UNIX环境,平时都没法上机实验。。。。

多谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP