LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-14-2005, 01:54 AM   #1
nano_mag
LQ Newbie
 
Registered: May 2005
Posts: 4

Rep: Reputation: 0
sed error message: extra characters after the command.


Dear Sir,
I am a newbie. I got the following message:
sed -f xclt.sed file1.f > file2.f
sed: xclt.sed line 8: extra characters after command
My xclt.sed file is as follows:
s/NRVALM=[0-9][0-9]*/NRVALM=100000/g
s/NRVALX=[0-9][0-9]*/NRVALX=95000/g
s/ICDM=[0-9][0-9]*/ICDM=20000/g
s/NVARM=[0-9][0-9]*/NVARM=1000/g
s/NCNSM=[0-9][0-9]*/NCNSM=5000/g
s/NFNCM=[0-9][0-9]*/NFNCM=100/g
s/NSYS=[0-9][0-9]*/NSYS=2000/g
/>>>START MAIN/,/>>>END MAIN/d
#/>>>START SUBSYSTEM/,/>>>END SUBSYSTEM/d
/>>>START IOFNC/,/>>>END IOFNC/d
/>>>START EXFNC/,/>>>END EXFNC/d

note: there is no error when I do the same job in unix system.

Could you please tell me a solution?
With best wishes.
 
Old 05-14-2005, 03:23 AM   #2
mschutte
Member
 
Registered: Jan 2005
Location: Innsbruck, Austria
Distribution: Debian GNU/Linux Lenny
Posts: 68

Rep: Reputation: 15
Probably because of the hash sign `#' at the beginning of line 9?
 
Old 05-14-2005, 11:01 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
from the sed info page:
Quote:
Often-Used Commands
===================

If you use `sed' at all, you will quite likely want to know these
commands.

`#'
[No addresses allowed.]

The `#' character begins a comment; the comment continues until
the next newline.

If you are concerned about portability, be aware that some
implementations of `sed' (which are not POSIX conformant) may only
support a single one-line comment, and then only when the very
first character of the script is a `#'.
I'm not sure what is meant by "[no address allowed]"
Perhaps if you added a space after the octothorpe character on line 9.

I copied and pasted your xclt.sed file and tried it out on a sample file which included
>>>START MAIN
#... more lines here.

>>>END MAIN

The program removed this range of lines without errors for me.
You might try deleting and re-entering line 8 in your script, in case there is a hidden white-space character at the end of line in your xclt.sed script.
 
Old 05-15-2005, 01:00 AM   #4
nano_mag
LQ Newbie
 
Registered: May 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you very much for your help. You are great!

The reason is :"You might try deleting and re-entering line 8 in your script, in case there is a hidden white-space character at the end of line in your xclt.sed script."

This "simple" miss wastes me too much time.

Thank you very much again.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can sed edit individual characters/portions of a sentence? TGWDNGHN Linux - Software 10 10-18-2005 04:50 AM
Extra characters in CuteCom jdupre Linux - Software 0 06-17-2005 07:02 PM
command not found error message dcarlis Linux - Newbie 3 10-21-2004 07:30 PM
KDE Konsole adding extra characters Tiyogi Linux - Software 2 04-26-2004 03:21 PM
using sed to grab two characters? nausicaa3000 Programming 4 04-20-2004 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:36 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