摘要: #!/bin/bashinc=""tab="\t"lsallfile () {for i in ${1}/*do echo -e "$inc${i##*/}" if [ -d "$i" ] then inc="$inc$tab" echo "" lsallfile "${i}" echo "" inc=${inc#"$tab"} fidone}if [ -z $1 ]then lsallfile ... 阅读全文
posted @ 2011-08-10 15:20 油炸西瓜 阅读(304) 评论(0) 推荐(0) 编辑
摘要: Table 5-3. Arithmetic test operators Test Comparison -lt Less than -le Less than or equal -eq Equal -ge Greater than or equal -gt Greater than -ne Not equal Table 5-2. File attribute operators Operato... 阅读全文
posted @ 2011-08-10 15:17 油炸西瓜 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 4.3.4. Extended Pattern MatchingBash provides a further set of patternmatching operators if the shoptoption extglob is switched on. Eachoperator takes one or more patterns, normally strings, separated bythe vertical bar ( | ). The extended pattern matching operatorsare given in Table 4-3.[8][8] Be a 阅读全文
posted @ 2011-08-10 10:14 油炸西瓜 阅读(468) 评论(0) 推荐(0) 编辑
摘要: Table2-6.emacs mode miscellaneous commandsCommandDescriptionCTRL-JSameas RETURNCTRL-LClearsthe screen, placing the current line at the top of the screenCTRL-MSameas RETURNCTRL-OSameas RETURN, then display next line in command historyCTRL-TTranspose two characters on either side ofpoint and move poin 阅读全文
posted @ 2011-08-09 19:44 油炸西瓜 阅读(237) 评论(0) 推荐(0) 编辑
摘要: sed 工具在了解了一些正规表示法的基础应用之后,再来呢?呵呵~两个东西可以玩一玩的,那就是 sed 跟底下会介绍的 awk 了! 这两个家伙可是相当的有用的啊!举例来说,鸟哥写的 logfile.sh 分析登录档的小程序 (第十九章会谈到),绝大部分分析关键字的取用、统计等等,就是用这两个宝贝蛋来帮我完成的!那么你说,要不要玩一玩啊?^_^我们先来谈一谈 sed 好了, sed 本身也是一个管线命令,可以分析 standard input 的啦! 而且 sed 还可以将数据进行取代、删除、新增、撷取特定行等等的功能呢!很不错吧~ 我们先来了解一下 sed 的用法,再来聊他的用途好了![roo 阅读全文
posted @ 2011-08-02 16:56 油炸西瓜 阅读(360) 评论(0) 推荐(0) 编辑