How to deal with an apostrophe

Solved
Hello,

I would like to know how to perform a
sed
on a string that contains an apostrophe.

Example:

For the string
l'application est nulle
, how can I correct the command
sed 's/l'application/L'application/g'
?

I know the syntax is wrong. Thank you for correcting it.

Best regards

1 answer

  1. Moderator
    Hello,

    The simplest way is to surround your expression
    sed
    with quotes:

    echo "the_tree" | sed -e "s/'/_/g"


    Good luck