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;
}
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
add a comment |
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
add a comment |
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
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
sed quoting
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
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You just need to escape the backslash:
's|lw 2,\|lw 2|g'
2
... because the single backslash would otherwise escape the|
used (for whatever reason) as a delimiter.
– Kusalananda♦
16 hours ago
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
});
}
});
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%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
You just need to escape the backslash:
's|lw 2,\|lw 2|g'
2
... because the single backslash would otherwise escape the|
used (for whatever reason) as a delimiter.
– Kusalananda♦
16 hours ago
add a comment |
You just need to escape the backslash:
's|lw 2,\|lw 2|g'
2
... because the single backslash would otherwise escape the|
used (for whatever reason) as a delimiter.
– Kusalananda♦
16 hours ago
add a comment |
You just need to escape the backslash:
's|lw 2,\|lw 2|g'
You just need to escape the backslash:
's|lw 2,\|lw 2|g'
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
add a comment |
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
add a comment |
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%2f535329%2freplace-specific-characters-containing-character-with-sed%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