sed -n '5,10 p' < /proc/cpuinfo
prints 5-10 lines of the file /proc/cpuinfo
I want to use something like
start=5
end=10
sed -n '$start,$end p' < /proc/cpuinfo
so that I can change the values of start and end form a script.
You need to use double quotes for variable expansion:
start=5 end=10; sed -n "$start,$end p" < /proc/cpuinfo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With