Tips合辑
- shell tips site:stackoverflow.com – AOL Search Results
- python tips site:stackoverflow.com – AOL Search Results
- awk tips site:stackoverflow.com – AOL Search Results
- regex tips site:stackoverflow.com – AOL Search Results
- idioms – tips’n’tricks in awk – Stack Overflow
- linux – loading local shell aliases to ssh session dynamicaly – Super User
- escaping – bash tips needed for understanding how to escape characters in command-line – Stack Overflow
- bash – Linux command line best practices and tips? – Server Fault
- shell – linux/bash tips for developers? – Stack Overflow
- What is your single most favorite command-line trick using Bash? – Stack Overflow
- Awk conditional sum from a CSV file – Stack Overflow
- PythonSpeed/PerformanceTips – Python Wiki
- 一些默认的用户名/密码 | ASPIRE
- Default Passwords | CIRT.net
==
- http://www.pement.org/awk/awk1line.txt
- http://bumble.sourceforge.net/books/awk/awk-book.txt.x.html
- http://bumble.sourceforge.net/books/awk/awk-book.txt
- http://wiki.bits.vib.be/index.php/Awk
==
用sed/awk对文件进行处理后,如果需要保存进行的修改,不能直接重定向,否则文件会被截断为空。
- http://stackoverflow.com/questions/3886773/using-sed-to-replace-the-contents-of-a-file-is-not-working-in-bash-script
- http://stackoverflow.com/questions/5171901/sed-command-find-and-replace-in-file-and-overwrite-file-doesnt-work-it-empties
Try this:
sed -i -e 's/<em\:update.*//g' install.rdf
When you redirect output to a file in truncate mode, the file is truncated first, before it’s read. Thus, the result is an empty file. Using sed -i avoids this.
Portable (and hopefully not too insecure) solution:
(set -C && sed -e 's/<em\:update.*//g' install.rdf > install.rdf.$$ && mv install.rdf.$$ install.rdf)
🙂
==
Awk的二维数组
搜索关键字:
awk two dimensional array
参考链接:
- http://www.grymoire.com/Unix/Awk.html#uh-23
- http://stackoverflow.com/questions/3060600/awk-array-iteration-for-multi-dimensional-arrays
- http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawk_87.html
- https://www.gnu.org/software/gawk/manual/html_node/Arrays-of-Arrays.html
==
Awk的sub和gsub函数
搜索关键字:
awk gsub