Re: replace all characters in only a portion of a line
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <CAEE75_24DYfnZ2ttE89yOmdmkE+adAdUZLXXU=Zhb0bXHS1fGw@mail.gmail.com> |
#!/bin/sed -Ef /^Name:/!b h s/[^:]*:([^,]*).*/\1/ s/[^ ]/*/g G s/(.*)\nName:[^,]*/Name:\1/ Save the whole thing, strip all but the name, redact nonblanks, append \n and the whole thing, sub in the redacted name for the original. [Non-text portions of this message have been removed]