why 'sed' does not work in this scriptWhy does this “while read” work in a terminal, but not in a shell...

What is a good example for artistic ND filter applications?

Why did Windows 95 crash the whole system but newer Windows only crashed programs?

How did the SysRq key get onto modern keyboards if it's rarely used?

Why is my fluorescent tube orange on one side, white on the other and dark in the middle?

Just how much information should you share with a former client?

How can I kill my goat?

Why were contact sensors put on three of the Lunar Module's four legs? Did they ever bend and stick out sideways?

Is there an antonym (a complementary antonym) for "spicy" or "hot" regarding food (I DO NOT mean "seasoned", but "hot")?

how to understand the error info "Illegal parameter number in definition of reserved@a. ...t{2+cdots+sqrt{2}}}}_{n项} , cdots 收敛.$}"

How does a poisoned arrow combine with the spell Conjure Barrage?

How to store my pliers and wire cutters on my desk?

Surviving a planet collision?

Rampant sharing of authorship among colleagues in the name of "collaboration". Is not taking part in it a death knell for a future in academia?

Summoning A Technology Based Demon

Was Donald Trump at ground zero helping out on 9-11?

How do I find the FamilyGUID of an exsting database

Complexity of verifying optimality in (mixed) integer programming

Is it possible for a particle to decay via gravity?

Why is it "on the inside" and not "in the inside"?

Piece of chess engine, which accomplishes move generation

What language is Raven using for her attack in the new 52?

Why are we moving in circles with a tandem kayak?

Was the Psych theme song written for the show?

Does Ubuntu reduces battery life?



why 'sed' does not work in this script


Why does this “while read” work in a terminal, but not in a shell script?Why does sed not remove my empty lines?Why does this script work on Ubuntu, and not Debian?Why does “bash -x” break this script?Using sed in shell script with multiline variablessed - why this does not work?Why does crontab works with wildcards (*) but not with numbers?In bash script variable assignment does not worksed not parsing t as a tabWhy does this rsync call not work properly?






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







0















I have this script,create_database, that has variables between two patterns:



##from script
v1=
v2=
##variables


and when i want to delete line between these patterns with sed it doesn't work:



sed -i '/##from script/,/##variables/d' /data3/create_database



i used this command in other scripts and it worked fine but i have no idea why i don't get the same result here. any suggestion?









share

























  • this deletes the patterns also, is that what you want to do?

    – Inian
    1 min ago


















0















I have this script,create_database, that has variables between two patterns:



##from script
v1=
v2=
##variables


and when i want to delete line between these patterns with sed it doesn't work:



sed -i '/##from script/,/##variables/d' /data3/create_database



i used this command in other scripts and it worked fine but i have no idea why i don't get the same result here. any suggestion?









share

























  • this deletes the patterns also, is that what you want to do?

    – Inian
    1 min ago














0












0








0








I have this script,create_database, that has variables between two patterns:



##from script
v1=
v2=
##variables


and when i want to delete line between these patterns with sed it doesn't work:



sed -i '/##from script/,/##variables/d' /data3/create_database



i used this command in other scripts and it worked fine but i have no idea why i don't get the same result here. any suggestion?









share














I have this script,create_database, that has variables between two patterns:



##from script
v1=
v2=
##variables


and when i want to delete line between these patterns with sed it doesn't work:



sed -i '/##from script/,/##variables/d' /data3/create_database



i used this command in other scripts and it worked fine but i have no idea why i don't get the same result here. any suggestion?







bash shell-script centos sed





share












share










share



share










asked 3 mins ago









BlackCrystalBlackCrystal

3951 silver badge14 bronze badges




3951 silver badge14 bronze badges
















  • this deletes the patterns also, is that what you want to do?

    – Inian
    1 min ago



















  • this deletes the patterns also, is that what you want to do?

    – Inian
    1 min ago

















this deletes the patterns also, is that what you want to do?

– Inian
1 min ago





this deletes the patterns also, is that what you want to do?

– Inian
1 min ago










0






active

oldest

votes














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%2f533051%2fwhy-sed-does-not-work-in-this-script%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f533051%2fwhy-sed-does-not-work-in-this-script%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...