Quantcast
Channel: How to use grep to get the matching part only, without introducing extra newlines - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 2 View Live

Answer by steeldriver for How to use grep to get the matching part only,...

If you don't mind using perl:mycommand | perl -lne 'print join "", /ban[a-z]*/g'The matches on each line are returned in a list context, which you can join with an empty delimiter.

View Article



How to use grep to get the matching part only, without introducing extra...

I have a output from a command that I want to pipe to some kind of grep command to obtain the part in each line that matches a given regex, and only output the matching part, without introducing...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>