Bootstrap FreeKB - Bash (Scripting) - wildcard character
Bash (Scripting) - wildcard character

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter 6edc69 in the box below so that we can be sure you are a human.