原帖由 "r2007" 發(fā)表:
吐血推薦兩篇精品文章,我的shell和text tools知識(shí)全靠這兩篇文章。
http://www.tldp.org/LDP/abs/abs-guide.pdf
http://www.student.northpark.edu/pemente/sed/sed1line.txt
原帖由 "c1l2d3"]版主給發(fā)點(diǎn)這樣的資料吧![/quote 發(fā)表:
[quote]Variable Expansion Formats
${#variable} length of variable
${variable:-word} value of variable if set and not null,else print word
${variable:=word} value of variable if set and not null,else variable is set to word, then expanded
${variable:+word}value of word if variable is set and not null, else nothing is substituted
${variable} value of variable if set and not null,else print "variable: parameter null or not set"
${variableword}value of variable if set and not null,else print value of word and exit
${variable#pattern}value of variable without the smallest beginning portion that matches pattern
${variable##pattern}value of variable without the largest beginning portion that matches pattern
${variable%pattern}value of variable without the smallest ending portion that matches pattern
${variable%%pattern}value of variable without the largest ending portion that matches pattern
${variable//pattern1/pattern2}replace all occurrences of pattern1 with pattern2 in variable
歡迎光臨 Chinaunix (http://72891.cn/) | Powered by Discuz! X3.2 |