1820592 Members
2216 Online
109626 Solutions
New Discussion юеВ

sed: command garbled:

 
Edgar_8
Regular Advisor

sed: command garbled:

Hi,

We have a 70 million record file that needs to do some substitution via sed but we are getting the following errors:

sed: command garbled: 6,
sed: command garbled: 1,-1p

Anyone have any ideas on resolving this?

Thanks in advance!
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: sed: command garbled:

A little more information, like the sed command you're using and a sample of the data might be helpful.


Pete

Pete
Pedro Cirne
Esteemed Contributor

Re: sed: command garbled:

Hi,

Please post the exact sed command you are using.

Pedro
Vibhor Kumar Agarwal
Esteemed Contributor

Re: sed: command garbled:

"Sed command garbled"

You will recieve this error whenever the syntax is wrong.

eg.
sed 's/a\/b/'
etc.

From what you have written, it looks like the nos. that you are giving is in a wrong position.

Post your sed.
Vibhor Kumar Agarwal
Kent Ostby
Honored Contributor

Re: sed: command garbled:

A generic description from http://www.unix.org.ua/orelly/unix/sedawk/ch02_03.htm:


The syntax of a sed command can be detailed, and it's easy to make a mistake or omit a required element. Notice what happens when incomplete syntax is entered:


$ sed -e 's/MA/Massachusetts' list
sed: command garbled: s/MA/Massachusetts

Sed will usually display any line that it cannot execute, but it does not tell you what is wrong with the command.[2] In this instance, a slash, which marks the search and replacement portions of the command, is missing at the end of the substitute command.

[2] Some vendors seem to have improved things. For instance, on SunOS 4.1.x, sed reports "sed: Ending delimiter missing on substitution: s/MA/Massachusetts".

GNU sed is more helpful:

$ gsed -e 's/MA/Massachusetts' list
gsed: Unterminated `s' command

So essentially, you're missing some key part of the syntax.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Edgar_8
Regular Advisor

Re: sed: command garbled:

Hi,

It appears as if the cause was resources on the server. We switched to a better server and we dont experience the same error.

Thanks in advance!