shell
健雄
擅长spark、数据挖掘、人脸识别、opencv
精通c/c++,scala语言,python
展开
-
让shell脚本在后台运行的两种方法
一、nohup使用nohup,其中test.sh为所执行的脚本,out.txt为输出信息的地方。 nohup sh test.sh>out.txt &二、sh使用sh,其中test.sh为所执行的脚本,out.txt为输出信息的地方。 sh test.sh>&out.txt &原创 2016-04-27 15:38:59 · 15612 阅读 · 1 评论 -
awk之if控制流
获取第四列并过滤出1720: cat 2016083000 | awk ‘BEGIN{OFS=’\t’}{if($4==”1720”){print $0}}’>tmp原创 2016-08-31 11:27:51 · 449 阅读 · 0 评论 -
vim多行注释
control+v进入视图块中,然后选择块大小(这里21行-28行) shit+i,调到块首行位置,并建入# esc,退出块操作后自动添加#到块其他行中原创 2016-09-22 19:55:56 · 475 阅读 · 0 评论 -
shell之trap的使用
temp.sh: exit 1 test.sh: trap “echo ‘[ERROR] 执行function: testfunction 失败’;exit” ERR sh ./temp.sh 执行./test.sh,脚本会调用trap语句,显示“[ERROR] 执行function: testfunction 失败”并退出。原创 2016-09-22 10:39:27 · 672 阅读 · 0 评论