sed command using regular expressions to replace the major minor and release numberImprove sed command to...

How is it believable that Euron could so easily pull off this ambush?

Should one save up to purchase a house/condo or maximize their 401(k) first?

How to append code verbatim to .bashrc?

Add elements inside Array conditionally in JavaScript

Is there a need for better software for writers?

What is the oldest instrument ever?

And now you see it II (the B side)

Expl3 and recent xparse on overleaf: No expl3 loader detected

While drilling into kitchen wall, hit a wire - any advice?

How to avoid making self and former employee look bad when reporting on fixing former employee's work?

Exactly which act of bravery are Luke and Han awarded a medal for?

History: Per Leviticus 19:27 would the apostles have had corner locks ala Hassidim today?

How to explain intravenous drug abuse to a 6-year-old?

Magical Modulo Squares

Light Switch Neutrals: Bundle all together?

As a small race with a heavy weapon, does enlarge remove the disadvantage?

Names of the Six Tastes

Is there an application which does HTTP PUT?

How do I give a darkroom course without negatives from the attendees?

What dice to use in a game that revolves around triangles?

How can it be that ssh somename works, while nslookup somename does not?

I'm attempting to understand my 401k match and how much I need to contribute to maximize the match

Trying to understand a summation

What are my options legally if NYC company is not paying salary?



sed command using regular expressions to replace the major minor and release number


Improve sed command to replace first instance of character and all following characters?How to replace the first line using sed?How to find & replace pattern WITHIN specific pattern using sedSED find and replace element in filename with incremental valuesIs there any alternative to the “sed -i” command in Solaris?sed command usage to replace names with spacesHow to use sed to replace a string using the line number on a remote machine using ssh?Using sed to replace numbers with @ inserts @ between every charactersed find 01.00.* and replace with ${version}Regular expression used in sed not giving the desired result between intervals






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







0















I am using Sed to replace the major, minor and release number in version.



In my case:




version=10.2.0.1 (version=major.minor.release.buildnumber)




I don't want to change buildnumber in this version number. I only want to change the major, minor and release using sed command.



existing



version=10.20.0.1


I want the output as version=11.21.2.1
(Build number should not change (last part in my version ))



I used below command



sed -i -r s/version=(.*)/version=11.21.2/g <filename>


it giving the output as



version=11.21.2 


which is not same as my requirement. Can someone please help me on this?










share|improve this question









New contributor



yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    0















    I am using Sed to replace the major, minor and release number in version.



    In my case:




    version=10.2.0.1 (version=major.minor.release.buildnumber)




    I don't want to change buildnumber in this version number. I only want to change the major, minor and release using sed command.



    existing



    version=10.20.0.1


    I want the output as version=11.21.2.1
    (Build number should not change (last part in my version ))



    I used below command



    sed -i -r s/version=(.*)/version=11.21.2/g <filename>


    it giving the output as



    version=11.21.2 


    which is not same as my requirement. Can someone please help me on this?










    share|improve this question









    New contributor



    yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      I am using Sed to replace the major, minor and release number in version.



      In my case:




      version=10.2.0.1 (version=major.minor.release.buildnumber)




      I don't want to change buildnumber in this version number. I only want to change the major, minor and release using sed command.



      existing



      version=10.20.0.1


      I want the output as version=11.21.2.1
      (Build number should not change (last part in my version ))



      I used below command



      sed -i -r s/version=(.*)/version=11.21.2/g <filename>


      it giving the output as



      version=11.21.2 


      which is not same as my requirement. Can someone please help me on this?










      share|improve this question









      New contributor



      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am using Sed to replace the major, minor and release number in version.



      In my case:




      version=10.2.0.1 (version=major.minor.release.buildnumber)




      I don't want to change buildnumber in this version number. I only want to change the major, minor and release using sed command.



      existing



      version=10.20.0.1


      I want the output as version=11.21.2.1
      (Build number should not change (last part in my version ))



      I used below command



      sed -i -r s/version=(.*)/version=11.21.2/g <filename>


      it giving the output as



      version=11.21.2 


      which is not same as my requirement. Can someone please help me on this?







      sed regular-expression






      share|improve this question









      New contributor



      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 49 mins ago









      αғsнιη

      18k103271




      18k103271






      New contributor



      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 1 hour ago









      yamini kondapaturiyamini kondapaturi

      1




      1




      New contributor



      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      yamini kondapaturi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          a compatible sed command would be:



          $ sed 's/version=[1-9]+[0-9]*.[0-9]+.[0-9]+/version=11.21.2/' <<<'version=10.20.0.1'
          version=11.21.2.1


          or with:



          sed 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


          or with:



          sed -E 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


          or even like below if a version major_number also could start with 0 like minor and release parts:



          sed -E 's/version=([0-9]+.){3}/version=11.21.2./' <<<'version=10.20.0.1'





          share|improve this answer


























            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
            });


            }
            });






            yamini kondapaturi is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f517692%2fsed-command-using-regular-expressions-to-replace-the-major-minor-and-release-num%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









            0














            a compatible sed command would be:



            $ sed 's/version=[1-9]+[0-9]*.[0-9]+.[0-9]+/version=11.21.2/' <<<'version=10.20.0.1'
            version=11.21.2.1


            or with:



            sed 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


            or with:



            sed -E 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


            or even like below if a version major_number also could start with 0 like minor and release parts:



            sed -E 's/version=([0-9]+.){3}/version=11.21.2./' <<<'version=10.20.0.1'





            share|improve this answer






























              0














              a compatible sed command would be:



              $ sed 's/version=[1-9]+[0-9]*.[0-9]+.[0-9]+/version=11.21.2/' <<<'version=10.20.0.1'
              version=11.21.2.1


              or with:



              sed 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


              or with:



              sed -E 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


              or even like below if a version major_number also could start with 0 like minor and release parts:



              sed -E 's/version=([0-9]+.){3}/version=11.21.2./' <<<'version=10.20.0.1'





              share|improve this answer




























                0












                0








                0







                a compatible sed command would be:



                $ sed 's/version=[1-9]+[0-9]*.[0-9]+.[0-9]+/version=11.21.2/' <<<'version=10.20.0.1'
                version=11.21.2.1


                or with:



                sed 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


                or with:



                sed -E 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


                or even like below if a version major_number also could start with 0 like minor and release parts:



                sed -E 's/version=([0-9]+.){3}/version=11.21.2./' <<<'version=10.20.0.1'





                share|improve this answer















                a compatible sed command would be:



                $ sed 's/version=[1-9]+[0-9]*.[0-9]+.[0-9]+/version=11.21.2/' <<<'version=10.20.0.1'
                version=11.21.2.1


                or with:



                sed 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


                or with:



                sed -E 's/version=[1-9]+[0-9]*(.[0-9]+){2}/version=11.21.2/' <<<'version=10.20.0.1'


                or even like below if a version major_number also could start with 0 like minor and release parts:



                sed -E 's/version=([0-9]+.){3}/version=11.21.2./' <<<'version=10.20.0.1'






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 42 mins ago

























                answered 52 mins ago









                αғsнιηαғsнιη

                18k103271




                18k103271






















                    yamini kondapaturi is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    yamini kondapaturi is a new contributor. Be nice, and check out our Code of Conduct.













                    yamini kondapaturi is a new contributor. Be nice, and check out our Code of Conduct.












                    yamini kondapaturi is a new contributor. Be nice, and check out our Code of Conduct.
















                    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%2f517692%2fsed-command-using-regular-expressions-to-replace-the-major-minor-and-release-num%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...

                    Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m