Bash (Scripting) - wildcard character

by
Jeremy Canfield |
Updated: March 08 2020
| Bash (Scripting) articles
Let's say you have a string of data that contains a wildcard character.
foo="*.example.com"
If you want to replace the wildcard character with something else in sed, you'll need to first escape the wildcard character in sed.
echo $foo | sed 's|\*|TEST|'
In this example, $foo will be become:
TEST.example.com
Did you find this article helpful?
If so, consider buying me a coffee over at