awk question
Polytropon
freebsd at edvax.de
Mon Oct 5 15:01:56 UTC 2015
On Mon, 5 Oct 2015 11:00:33 +0100, krad wrote:
> Just to add to the pile, if you want to pull a section out of a file you
> can do something along the lines of this.
>
> # for p in {a..z}; do echo $p; done | awk '/^k/,/^t/ {print $0}'
> k
> l
> m
> n
> o
> p
> q
> r
> s
> t
You can see this example in the EXAMPLES section of "man awk".
And you can omit "{ print $0 }" because that's the default
action anyway. Otherwise, your demonstration is fully valid
and a good reminder. :-)
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list