Sed search and replace returns error sed: -e expression #1, char 290: unterminated `s' command [duplicate]
This question already has an answer here:
Reference to a bash variable whose name contains dot
5 answers
sed: unterminated 's' command`
1 answer
I am trying to do a search and replace using sed.
But I have stared and stared, and cannot find the issue in my sed command.
If anyone can help me out, it would be much appreciated.
sed -i 's#D:\SL202_Data\workdir\nas\automation\wcm\Automated\Workflows\output\#https:\/\/san-ota-orch.linux.mybusiness.nl:8000\/view\/MY%20pipelines\/job\/CI-CD%20deployment%20on%20DEV%20lsrv1000\/${env.BUILD_NUMBER}\/Extent_20Report_20deluxe_20_28screenshots_21_29\/#g' /appl/jenkins/workspace/mybusiness_cicd_slave/test-reports/report.html
bash sed
marked as duplicate by Charles Duffy, kvantour, Matthieu Brucher, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 '18 at 12:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
show 1 more comment
This question already has an answer here:
Reference to a bash variable whose name contains dot
5 answers
sed: unterminated 's' command`
1 answer
I am trying to do a search and replace using sed.
But I have stared and stared, and cannot find the issue in my sed command.
If anyone can help me out, it would be much appreciated.
sed -i 's#D:\SL202_Data\workdir\nas\automation\wcm\Automated\Workflows\output\#https:\/\/san-ota-orch.linux.mybusiness.nl:8000\/view\/MY%20pipelines\/job\/CI-CD%20deployment%20on%20DEV%20lsrv1000\/${env.BUILD_NUMBER}\/Extent_20Report_20deluxe_20_28screenshots_21_29\/#g' /appl/jenkins/workspace/mybusiness_cicd_slave/test-reports/report.html
bash sed
marked as duplicate by Charles Duffy, kvantour, Matthieu Brucher, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 '18 at 12:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including thereplace
function that calls perl (with values passed in the environment), or thegsub_literal
function that uses awk (with values passed out-of-band using-v key="var"
).
– Charles Duffy
Nov 21 '18 at 15:11
3
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
1
The error message is weird - yoursed
command doesn't have 290 characters in it! Is this some weird Unicode problem?
– Jon
Nov 21 '18 at 16:25
|
show 1 more comment
This question already has an answer here:
Reference to a bash variable whose name contains dot
5 answers
sed: unterminated 's' command`
1 answer
I am trying to do a search and replace using sed.
But I have stared and stared, and cannot find the issue in my sed command.
If anyone can help me out, it would be much appreciated.
sed -i 's#D:\SL202_Data\workdir\nas\automation\wcm\Automated\Workflows\output\#https:\/\/san-ota-orch.linux.mybusiness.nl:8000\/view\/MY%20pipelines\/job\/CI-CD%20deployment%20on%20DEV%20lsrv1000\/${env.BUILD_NUMBER}\/Extent_20Report_20deluxe_20_28screenshots_21_29\/#g' /appl/jenkins/workspace/mybusiness_cicd_slave/test-reports/report.html
bash sed
This question already has an answer here:
Reference to a bash variable whose name contains dot
5 answers
sed: unterminated 's' command`
1 answer
I am trying to do a search and replace using sed.
But I have stared and stared, and cannot find the issue in my sed command.
If anyone can help me out, it would be much appreciated.
sed -i 's#D:\SL202_Data\workdir\nas\automation\wcm\Automated\Workflows\output\#https:\/\/san-ota-orch.linux.mybusiness.nl:8000\/view\/MY%20pipelines\/job\/CI-CD%20deployment%20on%20DEV%20lsrv1000\/${env.BUILD_NUMBER}\/Extent_20Report_20deluxe_20_28screenshots_21_29\/#g' /appl/jenkins/workspace/mybusiness_cicd_slave/test-reports/report.html
This question already has an answer here:
Reference to a bash variable whose name contains dot
5 answers
sed: unterminated 's' command`
1 answer
bash sed
bash sed
asked Nov 21 '18 at 15:06
CeesiebirdCeesiebird
62111
62111
marked as duplicate by Charles Duffy, kvantour, Matthieu Brucher, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 '18 at 12:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Charles Duffy, kvantour, Matthieu Brucher, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 22 '18 at 12:19
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including thereplace
function that calls perl (with values passed in the environment), or thegsub_literal
function that uses awk (with values passed out-of-band using-v key="var"
).
– Charles Duffy
Nov 21 '18 at 15:11
3
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
1
The error message is weird - yoursed
command doesn't have 290 characters in it! Is this some weird Unicode problem?
– Jon
Nov 21 '18 at 16:25
|
show 1 more comment
1
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including thereplace
function that calls perl (with values passed in the environment), or thegsub_literal
function that uses awk (with values passed out-of-band using-v key="var"
).
– Charles Duffy
Nov 21 '18 at 15:11
3
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
1
The error message is weird - yoursed
command doesn't have 290 characters in it! Is this some weird Unicode problem?
– Jon
Nov 21 '18 at 16:25
1
1
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including the
replace
function that calls perl (with values passed in the environment), or the gsub_literal
function that uses awk (with values passed out-of-band using -v key="var"
).– Charles Duffy
Nov 21 '18 at 15:11
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including the
replace
function that calls perl (with values passed in the environment), or the gsub_literal
function that uses awk (with values passed out-of-band using -v key="var"
).– Charles Duffy
Nov 21 '18 at 15:11
3
3
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
1
1
The error message is weird - your
sed
command doesn't have 290 characters in it! Is this some weird Unicode problem?– Jon
Nov 21 '18 at 16:25
The error message is weird - your
sed
command doesn't have 290 characters in it! Is this some weird Unicode problem?– Jon
Nov 21 '18 at 16:25
|
show 1 more comment
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
Consider using a tool that lets your values be passed out-of-band from your script -- that way the values you want to replace don't need to be escaped to be part of the script, avoiding this whole class of problems. See BashFAQ #21, particularly including the
replace
function that calls perl (with values passed in the environment), or thegsub_literal
function that uses awk (with values passed out-of-band using-v key="var"
).– Charles Duffy
Nov 21 '18 at 15:11
3
I literally copied-pasta your sample and it worked like charm on my PC. Sed version : sed (GNU sed) 4.2.2
– Matias Barrios
Nov 21 '18 at 15:19
That is really strange, I tried it again just to check but the error remains.
– Ceesiebird
Nov 21 '18 at 15:31
Can you please specify your sed version and OS version?
– Matias Barrios
Nov 21 '18 at 16:05
1
The error message is weird - your
sed
command doesn't have 290 characters in it! Is this some weird Unicode problem?– Jon
Nov 21 '18 at 16:25