heidsoft

Results 289 comments of heidsoft

http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html http://www.cnblogs.com/emanlee/archive/2013/09/07/3307642.html

http://blog.chinaunix.net/uid-8656705-id-2017937.html

# 目录判断 ``` if [ -d "$WORKING_DIR" ]; then rm -Rf $WORKING_DIR; fi if [ $( ls ) ]; then rm ; fi #!/bin/sh if [ -fe FILE ] then...

### ps 显示内存排序 ``` ps aux --sort -rss ps aux --sort rss ``` ### ps 根据pid 排序 ``` ps aux --sort pid ``` ### ps 显示信息案例 ``` EXAMPLES To see...

# grep 高级技艺 ``` grep 同时满足多个关键字 ① grep -E "word1|word2|word3" file.txt 满足任意条件(word1、word2和word3之一)将匹配。 ② grep word1 file.txt | grep word2 |grep word3 必须同时满足三个条件(word1、word2和word3)才匹配。 grep 同时排除多个关键字 不说废话, 例如需要排除 abc.txt 中的 mmm nnn...

# 数组使用 https://www.cyberciti.biz/faq/finding-bash-shell-array-length-elements/ https://stackoverflow.com/questions/10586153/split-string-into-an-array-in-bash https://stackoverflow.com/questions/15105135/bash-capturing-output-of-awk-into-array/15105237 https://www.cyberciti.biz/faq/finding-bash-shell-array-length-elements/

# 杀死进程 https://www.howtoing.com/how-to-kill-a-process-in-linux

# Best Practices for Writing Bash Scripts https://kvz.io/bash-best-practices.html https://yoone.eu/article/good-practices-for-writing-shell-scripts/ Use long options (logger --priority vs logger -p). If you're on cli, abbreviations make sense for efficiency. but when you're writing...

`cat pods1.list.log |tr -s '[:blank:]' ',' > pods2.list.cvs `

``` import ( "log" "strings" "github.com/astaxie/beego/validation" ) // 验证函数写在 "valid" tag 的标签里 // 各个函数之间用分号 ";" 分隔,分号后面可以有空格 // 参数用括号 "()" 括起来,多个参数之间用逗号 "," 分开,逗号后面可以有空格 // 正则函数(Match)的匹配模式用两斜杠 "/" 括起来 // 各个函数的结果的key值为字段名.验证函数名 type user...