Editing Specific Lines
Explore how to edit specific lines in text streams using sed commands. Understand addressing lines by text patterns, line numbers, or regular expressions to perform precise replacements and preserve file integrity during text processing.
We'll cover the following...
We'll cover the following...
Asterisks in markdown
We can italicize words or phrases in Markdown documents by surrounding them with asterisks or underscores, depending on the Markdown processor we’re using. In the document we created in the previous lesson, we’re using asterisks for bold words.
Let’s try using a basic substitution to replace them:
$ sed -e 's/*/_/g' document.md
Run the complete code on the terminal below for practice.
cat << 'EOF' > document.md
This is *very* important text with *very* important words.
* These words are not important.
* Neither are these.
You can *always* tell very important text because it's in italics.
EOF
sed -e 's/*/_/g' ...