chore(sed): comment non-space blocks in lines

This commit is contained in:
Michele Cereda
2024-05-02 02:03:49 +02:00
parent d068c616f0
commit 19ae542d2b
2 changed files with 7 additions and 0 deletions

View File

@@ -9,6 +9,9 @@
## TL;DR
```sh
# Quote any set of characters that is not a space.
sed -E 's|([[:graph:]]+)|"\1"|g'
# Delete lines matching "OAM" from a file.
# Overwrite the source file with the changes.
sed '/OAM/d' -i .bash_history

4
snippets/sed.sh Normal file
View File

@@ -0,0 +1,4 @@
#!sh
# Quote whatever is not a space.
sed -E 's|([[:graph:]]+)|"\1"|g'