FreeKB - Escape wildchard in sed in BASH
Escape wildchard in sed in BASH

Home > Search

Let's say you have a string of data that contains a wildcard character.



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:


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

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