Does sed have an option similar to grep -q
, where it returns a 1 or 0 depending on if it actually finds a string match or not?
The reason I ask is in some cases I use sed
in particular ways, like finding the first match after a given line number, or setting a capture group and acquiring a string that way, so I wanted to see if sed
had anything built in that would check if anything is returned because I want to throw an error back to the user and exit my bash script if a match isn't found