User Tools

Site Tools


sed:change:parenthesize_first_character_of_each_word

SED - Change - Parenthesize first character of each word

Prints the first character of every word in parenthesis.

echo "My name is Peter" | sed 's/\(\b[A-Z]\)/\(\1\)/g'

result:

(M)y name is (P)eter
sed/change/parenthesize_first_character_of_each_word.txt · Last modified: 2020/08/17 23:56 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki