I have file called "quota.txt" as below:
DISK_info_start:/usr
Disk: /usr
CURRENT=81
DISK_info_end:/usr
DISK_info_start:/usr/var
Disk: /usr/tmp
CURRENT=1
DISK_info_end:/usr/var
I have a variable as below:
entry=/usr
I want extract paragraph starting From DISK_info_start:$entry to DISK_info_end:$entry like this:
DISK_info_start:/usr
Disk: /usr
CURRENT=81
DISK_info_end:/usr
I tried this command:
sed -n "\|DISK_info_start:$entry$|,\|DISK_info_end:$lines$|p" quota.txt
but, it is not doing an exact match which is what i was looking for.
Can you tweak this command for me or provide an alternative?
$lines
? – JigglyNaga Oct 10 '18 at 19:08