Unix Shell - Re: please help with sed

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > Re: please help with sed





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 Re: please help with sed
Bill Marcum

2006-10-19, 7:23 pm

On 19 Oct 2006 15:04:09 -0700, podi.ex@gmail.com
<podi.ex@gmail.com> wrote:
> Hi,
>
> I have a file entry.reg containg lines as follows:
>
> [HKEY_LOCAL_MACHINE\SOFTWARE]
>
> In cygwin, I want to replace all the lines starting with "[" to "[-".
> That is, my resulting file would look like
>
> [-HKEY_LOCAL_MACHINE\SOFTWARE]
>
> I tried the command as follows but the leading characters become bunch
> of unicode
>
> sed 's/\[/\[-/' entry.reg > new.reg
>
> new.reg looks like
>
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????-HKEY_LOCAL_MACHINE\SOFTWARE
>
> How do I escape the "[" character in sed?
>

Try setting LANG=C before the sed command. If that doesn't help, post
the output of
od -tx1z entry.reg


--
<Apple_IIe> anyone seen my 80 column card?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com