Unix Shell - SED spaces

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2004 > SED spaces





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SED spaces
mike

2004-10-04, 6:01 pm

I need some help with sed command. I am trying to
add some spaces and a note to the end of each line.
I trided:

sed 's/location\$/\(location note\)/' < locationfile

the problem is UNIX only sees:

sed 's/location\$/\(location
and report error: Ending delimiter not found on substitution.

I can not figure out how to get cshell to see the entire sed command
after the spaces. Any help would be great.
Chris F.A. Johnson

2004-10-04, 6:01 pm

On 2004-10-04, mike wrote:
> I need some help with sed command. I am trying to
> add some spaces and a note to the end of each line.
> I trided:
>
> sed 's/location\$/\(location note\)/' < locationfile


Do not escape the end-of-line character ($):

sed 's/location$/\(location note\)/' < locationfile

> the problem is UNIX only sees:
>
> sed 's/location\$/\(location
> and report error: Ending delimiter not found on substitution.
>
> I can not figure out how to get cshell to see the entire sed command
> after the spaces. Any help would be great.



--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Eric Moors

2004-10-05, 3:01 am

mike wrote:

> I need some help with sed command. I am trying to
> add some spaces and a note to the end of each line.
> I trided:
>
> sed 's/location\$/\(location note\)/' < locationfile
>


those aren't spaces.
insert normal spaces, not crontrol characters

> the problem is UNIX only sees:
>
> sed 's/location\$/\(location
> and report error: Ending delimiter not found on substitution.
>
> I can not figure out how to get cshell to see the entire sed command
> after the spaces. Any help would be great.


try it with proper spaces:

sed 's/location$/\(location note\)/' < locationfile

Eric
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com