LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: Disabled
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
Miati
Member
 
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
ndc85430
Member
 
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

's/pattern/replacement/',

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
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
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
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



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 host.mydomain.com 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 PM.

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