Skip to main content
12 events
when toggle format what by license comment
Feb 19, 2018 at 15:41 history edited Jeff Schaller CC BY-SA 3.0
comand -> command copy-pasta fix
Sep 12, 2013 at 17:24 comment added slm @RahulPatil - thanks for asking. I've updated the answer with a description of what's going on, let me know if it's good enough.
Sep 12, 2013 at 17:24 history edited slm CC BY-SA 3.0
added 899 characters in body
Sep 12, 2013 at 16:13 comment added Rahul Patil @slm I knew only basic of sed, this answer is amazing, but can you please explain. like what is meaning of \1
Sep 11, 2013 at 5:26 comment added user46865 Can you explain what the parenthesis are for? How is [A-Z] different from ([A-Z]) Also, what is the + operator for? The \1 is for pattern matching, correct?
Sep 11, 2013 at 1:28 comment added Kevin To do it in just headers, add /^[A-Z]/ - sed '/^[A-Z]/s/\(.\)\1/\1/g'
Sep 10, 2013 at 23:49 vote accept CommunityBot
Sep 10, 2013 at 23:47 history edited slm CC BY-SA 3.0
added 440 characters in body
Sep 10, 2013 at 23:45 comment added slm @JonSmith - you could take the first example and remove the a-z bit from the set of characters. sed 's/\([A-Z]\)\1\+/\1/g'
Sep 10, 2013 at 23:43 comment added user46865 Thank you. Rremoving all duplicates isn't what I want to do; e.g., "command" should stay "command" but "NNAAMMEE" should become "NAME" is there a way to use sed with 's/(.)\1/\1/g' but only for double-capitals?
Sep 10, 2013 at 23:16 history edited slm CC BY-SA 3.0
added 392 characters in body
Sep 10, 2013 at 22:52 history answered slm CC BY-SA 3.0