随笔分类 -  shell

shell
摘要:1.t e s t一般有两种格式,即:test condition或[ c o n d i t i o n ]使用方括号时,要注意在条件两边加上空格。2.文件测试-d 目录 -s文件长度大于0、非空 -f正规文件 -w可写 -L符号连接 -u文件有s u i d位设置 -r可读 -x可执行3.逻辑操作符-a 逻辑与,操作符两边均为真,结果为真,否则为假。-o 逻辑或,操作符两边一边为真,结果为真,否则为假。! 逻辑否,条件为假,结果为真。4.字符串测试(1)test “str” (2)test str_opt “str” (3)test “str1” str_opt... 阅读全文
posted @ 2012-04-05 22:11 望月追忆 阅读(225) 评论(0) 推荐(0)
摘要:文件内容是:111222ABCABCABCabcabcabc444555我想匹配出现3次ABC的行如何写正则表达式? 阅读全文
posted @ 2012-04-05 21:29 望月追忆 阅读(159) 评论(0) 推荐(0)
摘要:#include <stdio.h>int main(void){ printf("hello\n"); printf("I am mini2440. And Wish you be a best man!\n"); return 0;}int main(void){ printf("hello\n"); printf("I am mini2440. And Wish you be a best man!\n"); return 0;}intintint main(void){ printf(" 阅读全文
posted @ 2012-04-05 10:25 望月追忆 阅读(297) 评论(0) 推荐(0)
摘要:shell特殊字符 阅读全文
posted @ 2012-04-02 13:08 望月追忆 阅读(205) 评论(0) 推荐(0)
摘要:#A Example#!/bin/shecho "aa # aa"echo 'qq # qq'echo \# adfa ad ad#echo ${PATH#*:}以上都不是注释 阅读全文
posted @ 2012-04-02 13:02 望月追忆 阅读(164) 评论(0) 推荐(0)