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;
}
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
New contributor
add a comment |
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
New contributor
add a comment |
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
New contributor
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
sed regular-expression
New contributor
New contributor
edited 49 mins ago
αғsнιη
18k103271
18k103271
New contributor
asked 1 hour ago
yamini kondapaturiyamini kondapaturi
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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'
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'
add a comment |
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'
add a comment |
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'
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'
edited 42 mins ago
answered 52 mins ago
αғsнιηαғsнιη
18k103271
18k103271
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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