![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
zqilli
这个作者很懒,什么都没留下…
展开
-
sed常用方法
sed -n '1,10p' example.txt 取前10行sed -n '5,$'p example.txt 取5行到最后一行sed '1,10d' example.txt 删除前10行sed '2d' example.txt 删除第2行sed '1,2d' example.txt 删除1~2行sed '1,2!d' example.txt 删除1~2之外的所有行sed "n;d" ...原创 2021-04-16 15:23:41 · 586 阅读 · 0 评论 -
shell常用语法
1、判断语法if [ command1 ]; then do_command1elif [ command2 ]; then do_command2else do_command3fi#上条命令运行结果判断commandif [ $? -eq 0 ]; then echo "command execution success"elif [ $? -eq 1 ]; then echo "command execution fail"fica原创 2021-04-15 10:03:15 · 139 阅读 · 0 评论