﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-vinsonxing</title><link>http://www.blogjava.net/vinsonxing/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 11:42:46 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 11:42:46 GMT</pubDate><ttl>60</ttl><item><title>linux 命令集 - shell语法中的test</title><link>http://www.blogjava.net/vinsonxing/archive/2009/02/18/255294.html</link><dc:creator>vinsonxing</dc:creator><author>vinsonxing</author><pubDate>Wed, 18 Feb 2009 08:09:00 GMT</pubDate><guid>http://www.blogjava.net/vinsonxing/archive/2009/02/18/255294.html</guid><wfw:comment>http://www.blogjava.net/vinsonxing/comments/255294.html</wfw:comment><comments>http://www.blogjava.net/vinsonxing/archive/2009/02/18/255294.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/vinsonxing/comments/commentRss/255294.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/vinsonxing/services/trackbacks/255294.html</trackback:ping><description><![CDATA[<h2>linux 命令集 - shell语法中的test</h2>
<div class="t_msgfont" id="postmessage_196">1）判断表达式 <br />
<br />
if test&nbsp;&nbsp;(表达式为真)<br />
<br />
if test !表达式为假<br />
<br />
test 表达式1 &#8211;a 表达式2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;两个表达式都为真<br />
<br />
test 表达式1 &#8211;o 表达式2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;两个表达式有一个为真<br />
<br />
<br />
<br />
2）判断字符串<br />
<br />
test &#8211;n 字符串&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;字符串的长度非零<br />
<br />
test &#8211;z 字符串&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;字符串的长度为零<br />
<br />
test 字符串1＝字符串2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;字符串相等<br />
<br />
test 字符串1！＝字符串2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;字符串不等<br />
<br />
<br />
<br />
3）判断整数<br />
<br />
test 整数1 &#8211;eq 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;整数相等<br />
<br />
test 整数1 &#8211;ge 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;整数1大于等于整数2<br />
<br />
test 整数1 &#8211;gt 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 整数1大于整数2<br />
<br />
test 整数1 &#8211;le 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 整数1小于等于整数2<br />
<br />
test 整数1 &#8211;lt 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;整数1小于整数2<br />
<br />
test 整数1 &#8211;ne 整数2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;整数1不等于整数2<br />
<br />
<br />
<br />
4）判断<span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E6%96%87%E4%BB%B6">文件</span><br />
<br />
test&nbsp;&nbsp;File1 &#8211;ef&nbsp;&nbsp;File2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 两个文件具有同样的设备号和i结点号<br />
<br />
test&nbsp;&nbsp;File1 &#8211;nt&nbsp;&nbsp;File2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件1比文件2 新<br />
<br />
test&nbsp;&nbsp;File1 &#8211;ot&nbsp;&nbsp;File2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件1比文件2 旧<br />
<br />
test &#8211;b File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是块设备文件<br />
<br />
test &#8211;c File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是字符设备文件<br />
<br />
test &#8211;d File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是目录<br />
<br />
test &#8211;e File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在<br />
<br />
test &#8211;f File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;文件存在并且是正规文件<br />
<br />
test &#8211;g File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是设置了组ID<br />
<br />
test &#8211;G File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且属于有效组ID<br />
<br />
test &#8211;h File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是一个符号链接（同-L）<br />
<br />
test &#8211;k File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且设置了sticky位<br />
<br />
test &#8211;b File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是块设备文件<br />
<br />
test &#8211;L File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是一个符号链接（同-h）<br />
<br />
test &#8211;o File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且属于有效用户ID<br />
<br />
test &#8211;p File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是一个命名管道<br />
<br />
test &#8211;r File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;文件存在并且可读<br />
<br />
test &#8211;s File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且是一个套接字<br />
<br />
test &#8211;t FD&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;文件描述符是在一个终端打开的<br />
<br />
test &#8211;u File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且设置了它的set-user-id位<br />
<br />
test &#8211;w File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;文件存在并且可写<br />
<br />
test &#8211;x File&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 文件存在并且可执行</div>
<img src ="http://www.blogjava.net/vinsonxing/aggbug/255294.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/vinsonxing/" target="_blank">vinsonxing</a> 2009-02-18 16:09 <a href="http://www.blogjava.net/vinsonxing/archive/2009/02/18/255294.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转载 悟透JavaScript </title><link>http://www.blogjava.net/vinsonxing/archive/2009/02/16/254846.html</link><dc:creator>vinsonxing</dc:creator><author>vinsonxing</author><pubDate>Mon, 16 Feb 2009 02:51:00 GMT</pubDate><guid>http://www.blogjava.net/vinsonxing/archive/2009/02/16/254846.html</guid><wfw:comment>http://www.blogjava.net/vinsonxing/comments/254846.html</wfw:comment><comments>http://www.blogjava.net/vinsonxing/archive/2009/02/16/254846.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/vinsonxing/comments/commentRss/254846.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/vinsonxing/services/trackbacks/254846.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 引子&nbsp;&nbsp;&nbsp; 编程世界里只存在两种基本元素，一个是数据，一个是代码。编程世界就是在数据和代码千丝万缕的纠缠中呈现出无限的生机和活力。&nbsp;&nbsp;&nbsp;&nbsp;数据天生就是文静的，总想保持自己固有的本色；而代码却天生活泼，总想改变这个世界。&nbsp;&nbsp;&nbsp; 你看，数据代码间的关系与物质能量间的关系有着惊人的...&nbsp;&nbsp;<a href='http://www.blogjava.net/vinsonxing/archive/2009/02/16/254846.html'>阅读全文</a><img src ="http://www.blogjava.net/vinsonxing/aggbug/254846.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/vinsonxing/" target="_blank">vinsonxing</a> 2009-02-16 10:51 <a href="http://www.blogjava.net/vinsonxing/archive/2009/02/16/254846.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>