摘要: A '-' turns the option on, while '+' turns it off.Table 6-1. Declare options Option Meaning -a The variables are treated as arrays -f Use function names only -F Display function names without definiti... 阅读全文
posted @ 2011-08-10 21:08 油炸西瓜 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashtab="\t"pipe="|"dash="--------"fmt="$pipe${dash}"lsallfile () {for i in ${1}/*do if [ -f "$i" ] then echo -e "$fmt${i##*/}" elif [ -d "$i" ] then echo -e "$fmt${i##*/}/" fmt="$pipe$tab$fmt"... 阅读全文
posted @ 2011-08-10 16:20 油炸西瓜 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #!/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) 编辑