Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-24-2015, 09:03 PM   #1
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
Can't determine error

sed: -e expression #1, char 31: unterminated `s' command

Does anyone know what might be causing this error message? It seems to also cause some strange empty files like sedTlU3nF and sedCrMjXk to be created. I get this error after adding some code to a script that is correct. The script runs ok even with the errors.
Old 01-24-2015, 09:15 PM   #2
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
Seeing the command that you used would help us determine what caused that error.
Most likely, your sed command(s) in the script.
Old 01-25-2015, 03:03 AM   #3
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
Well, the problem is exactly what the error message tells you. Remember that for a substitution in sed, the syntax is


assuming you're using '/' to separate parts in the command (you can use other characters, of course, but that isn't important here). If you missed out one of the '/' characters, you'd get the "unterminated command" message, so I'd at least check that.
Old 01-25-2015, 07:21 AM   #4
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Thanks. The problem is that I am not using a sed instruction in the new code inclusions. I have looked through the other sed instructions in the code and can't find anything wrong. I will go through them again.

What is even more confusing is that the script eventually stops creating the empty files and the error message goes away by itself. This morning there are no new bogus files and the error message is no longer being displayed.

This problem has been miraculously solved!
Old 01-25-2015, 07:30 AM   #5
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Possibly one of these 3 sed instructions is the problem:

sed 's/ / /g' $filePath/Prevstats.html > $filePath/temp.txt
sed '/No LSB/d' $filePath/templ.txt
sed -e 's/$/<br>/' $filePath/templ.txt >> $webpgpath/$webpgnm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR cannot determine address family of unix1adm Red Hat 4 01-15-2014 12:41 PM
configure: error: Cannot determine executable suffix manoj7410 Linux - Distributions 0 06-30-2012 03:19 AM
[SOLVED] ERROR: Date::Manip unable to determine TimeZone. ewalter Linux - Newbie 2 06-29-2012 02:58 PM
[SOLVED] Postfix error, can't determine the cause of the problem bluekill14 Linux - Server 8 10-18-2011 06:50 PM
smbclient: ERROR: Could not determine network interfaces uselpa Slackware 1 12-10-2004 12:09 PM

All times are GMT -5. The time now is 09:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration