replace specific characters containing “” character with sedReplace a range of text with special...

Aderet's Anonymous Sefer and Haskamah?

Is there any way to stop a user from creating executables and running them?

Can renaming a method preserve encapsulation?

How do you deal with the emotions of not being the one to find the cause of a bug?

Escape Velocity - Won't the orbital path just become larger with higher initial velocity?

Website error: "Walmart can’t use this browser"

Create the least compressible picture

Why am I not billed for EOB balance?

Graphs for which a calculus student can reasonably compute the arclength

A continuous water "planet" ring around a star

Modeling the uncertainty of the input parameters

How can I communicate my issues with a potential date's pushy behavior?

What is a "soap"?

Why is the Lucas test not recommended to differentiate higher alcohols?

Does one make a shehecheyanu on "used" jewelry?

How can I find an old paper when the usual methods fail?

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?

If I animate and control a zombie, does it benefit from Undead Fortitude when it's reduced to 0 HP?

Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?

Can I enter the USA with an E-2 visa and a one way flight ticket?

Help, I cannot decide when to start the story

Running code generated in realtime in JavaScript with eval()

Why did IBM make public the PC BIOS source code?

Does fossil fuels use since 1990 account for half of all the fossil fuels used in history?



replace specific characters containing “” character with sed


Replace a range of text with special characters using sedReplace non-printable characters in perl and sedsed - find and replace text containing “/”Print out certain line of filesed find replace issueUpdate or append JAVA_HOME with sedreplacing and adding at the end of lines with one line sed commandUsing sed to replace a string where the replacement contains whitespace






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















I would like to replace the following sentence "lw 2," with the sentence "lw 2" however I cannot do it with



sed -i 's|lw 2,|lw 2|g' "filname"


I get the following error



sed: -e expression #1, char 15: unterminated `s' command


It seems that it doesn't like the ""










share|improve this question

































    2















    I would like to replace the following sentence "lw 2," with the sentence "lw 2" however I cannot do it with



    sed -i 's|lw 2,|lw 2|g' "filname"


    I get the following error



    sed: -e expression #1, char 15: unterminated `s' command


    It seems that it doesn't like the ""










    share|improve this question





























      2












      2








      2








      I would like to replace the following sentence "lw 2," with the sentence "lw 2" however I cannot do it with



      sed -i 's|lw 2,|lw 2|g' "filname"


      I get the following error



      sed: -e expression #1, char 15: unterminated `s' command


      It seems that it doesn't like the ""










      share|improve this question
















      I would like to replace the following sentence "lw 2," with the sentence "lw 2" however I cannot do it with



      sed -i 's|lw 2,|lw 2|g' "filname"


      I get the following error



      sed: -e expression #1, char 15: unterminated `s' command


      It seems that it doesn't like the ""







      sed quoting






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 16 hours ago









      Bart

      1,0571 gold badge3 silver badges17 bronze badges




      1,0571 gold badge3 silver badges17 bronze badges










      asked 16 hours ago









      Dimitris MintisDimitris Mintis

      12610 bronze badges




      12610 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          2














          You just need to escape the backslash:



          's|lw 2,\|lw 2|g'





          share|improve this answer





















          • 2





            ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

            – Kusalananda
            16 hours ago
















          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535329%2freplace-specific-characters-containing-character-with-sed%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          You just need to escape the backslash:



          's|lw 2,\|lw 2|g'





          share|improve this answer





















          • 2





            ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

            – Kusalananda
            16 hours ago


















          2














          You just need to escape the backslash:



          's|lw 2,\|lw 2|g'





          share|improve this answer





















          • 2





            ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

            – Kusalananda
            16 hours ago
















          2












          2








          2







          You just need to escape the backslash:



          's|lw 2,\|lw 2|g'





          share|improve this answer













          You just need to escape the backslash:



          's|lw 2,\|lw 2|g'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 16 hours ago









          Paul BurrowsPaul Burrows

          1495 bronze badges




          1495 bronze badges











          • 2





            ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

            – Kusalananda
            16 hours ago
















          • 2





            ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

            – Kusalananda
            16 hours ago










          2




          2





          ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

          – Kusalananda
          16 hours ago







          ... because the single backslash would otherwise escape the | used (for whatever reason) as a delimiter.

          – Kusalananda
          16 hours ago




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535329%2freplace-specific-characters-containing-character-with-sed%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...