The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
252 views

How to print strings matching a pattern with grep?

I want to get a list of strings matching the following pattern: CLASS_NAME:"*" where * represents any number of characters. I tried: grep -o CLASS_NAME:\".*\" script.js and grep -o ...
2
votes
1answer
72 views

Does [[:space:]] work for sed patterns on all Linux distros?

Using [[:space:]] looks a little non-elegant and, quite frankly, Microsoft-ish for sed match patters. I was trying to extract "Last" out of "First Last" and either of the following worked: echo ...
1
vote
3answers
174 views

Match a single character in a string bash script

My issues is that I want to read a character from the stdin and compare it with a string value. If that character exists then I want to display a message. Eg, saving % into the variable $a: $ read a ...
0
votes
1answer
71 views

How to add parens around text

How can I use sed to replace text and also append to end of line for the match in question? I have a sed file which is doing many substitutions. One of them changes ~= to match( using /=\~/ ...