码迷,mamicode.com
首页 > 其他好文 > 详细

awk, sed, xargs, bash

时间:2019-02-11 21:30:40      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:dev   clu   http   har   读取   spl   sed   remove   mac   

 
awk:
split($1, arr, “\t”)
 
sed:
sed -n ‘42p‘ file
sed ‘42d‘ file
sed ‘s/replace_pattern/replace_str/g‘ file
sed ‘/remove_pattern/d‘ file
sed -i file #(inplace)直接修改读取的文件内容,而不是输出到终端
 
xargs:
xargs -n1 -i cmd {} 
 
bash:
  • $HOSTNAME - The hostname of the machine the script is running on.
  • Single quotes will treat every character literally.
  • Double quotes will allow you to do substitution (that is include variables within the setting of the value).
  • read varNameRead input from the user and store it in the variable varName./dev/stdinA file you can read to get the STDIN for the Bash script
  • $(( expression ))  Return the result of the expression.${#var}Return the length of the variable var.
 

awk, sed, xargs, bash

标签:dev   clu   http   har   读取   spl   sed   remove   mac   

原文地址:https://www.cnblogs.com/yaoyaohust/p/10363211.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!