一品网
  • 首页

linux 中利用变量作为行号删除指定的行


1、

root@PC1:/home/test3# ls
a.txt
root@PC1:/home/test3# cat a.txt
1 e d
2 a g
3 w e
4 d g
5 g j
6 e j
7 l m
8 i n
root@PC1:/home/test3# a=3                            ## 行号  3
root@PC1:/home/test3# b=6                            ## 行号  6
root@PC1:/home/test3# sed $(($a)),$(($b))d a.txt     ## 利用变量作为行号删除指定的行
1 e d
2 a g
7 l m
8 i n

linuxshell

相关


linux shell 删除满足正则表达式的文件

Linux Shell获取CCTV5节目单

linux shell利用nc命令,检测别的机器端口

Linux shell脚本 删除日志文件保留最新的 3 条文件

Linux Shell脚本自动化编程实战-开篇介绍

linux shell实现将每隔一个空格的两列并排为一列

Linux Shell脚本自动化编程实战-shell变量(二)

说说Linux shell外部命令与内建命令

Linux Shell简介

Linux shell ${}简单用法

Linux shell 判断变量是否包含某个字符串的几种方法

[Dockerfile Linux Shell] if else语句中比较字符串

标签

一品网 冀ICP备14022925号-6