How to deal with an apostrophe

Solved
Jakol -  
mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   -
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. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 944
     
    Hello,

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

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


    Good luck
    0