WebSep 5, 2024 · 3. It's because backticks ( ``) interpret backslashes. This way your \\\\ in backticks work like \\ without backticks. Then they get to sed as \, because double-quoting also interprets backslashes. And ten sed interprets \' as escaped '. Use $ () instead of backticks. This syntax won't introduce additional level of interpreting backslashes. WebNov 2, 2009 · That exact command works on my box. Note that you probably want to use double quotes, because as you posted the command is evaluated with variables not expanded. You may also want to use -i option to edit the file in-place instead of printing the result of replace command.
Fix: Sed output “char X: unterminated `s’ command”
WebMay 5, 2024 · The problem with your sed command. s/groupid = []/groupid = [ 2 ]/ is that [and ] are special characters on the LHS of a substitute command, so it's interpreting]/groupid = [ 2 as a set of characters to match after groupid = .Since that "eats" the first /, your command looks like s/pattern/ instead of s/pattern/replacement.. At a minimum, you need to escape … WebMar 20, 2014 · sed -e expression #1, char 7: unterminated 's' command My understanding of sed is not great so im sure its an easy fix but couldn't work it out myself. If you need any … bryanston to randburg
sed: -e expression #1, char 57: unterminated `s
WebNov 2, 2009 · That exact command works on my box. Note that you probably want to use double quotes, because as you posted the command is evaluated with variables not … WebAug 29, 2024 · The correct syntax is : sed 's/ReplaceThisText/ByThis/g' sed -e 's/,//g' -e 's/\t/,/g' "${tsv_file}" >> "${csv_file}" # replace comma by nothing, then replace tab by comma The -e option gives the ability to chain actions-e script, --expression=script add the script to the commands to be executed WebMar 3, 2015 · unterminated `s' command -- running sed from a .sh script, to replace a string that includes a "=" Ask Question Asked 8 years, 1 month ago. ... sed: -e expression #1, char 7: unterminated `s' command Looking at the error, I could find it is the problem with = in the search/replace strings. I tried escaping this, ... bryanston to linden