Skip to content

Instantly share code, notes, and snippets.

@packetchef

packetchef/sed_tips.sed

Last active Aug 1, 2020
Embed
What would you like to do?
# For the string "abc:123", append "def" to "abc"
$ echo "abc:123" | sed 's/abc/&def/'
# Add a space after every alphanumeric character
$ echo "abc:123" | sed 's/[A-Za-z0-9]/& /g'
# Use stdin instead of passing a file
$ sed 's/abc/def/' <&1
abcdefghi
defdefghi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.