| 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?
|