Thursday, January 27, 2011

Re: Problem with APostrophe

Reply to message «Problem with APostrophe»,
sent 07:25:52 28 January 2011, Friday
by naaj_ila:

> I want to do all files so i went to the terminal and i typed like this
> vim -c "argdo %s/`ERROR/&SUCCESS/gc | update " *.log
>
> It gives error Unmatched `
> If i removed Apostrophe "`"(left side of Keybord button 1) then it works
> fine
This is not vim, but shell error. Normally shell substitutes contents of
«`command`» with output (stdout) of this command, you may see this by launching
«echo "`tty`"», this will print something like «/dev/pts/11», not «`tty`». In
your example shell tries to do this also, but fails because there is no second
backtick that indicates end of embedded command. You may disable this either by
escaping «`» with backslash or by using single quotes in which «`» is not
interpretted specially.

Original message:
> I need to replace `ERROR with &SUCCESS in all the files(120 files)
>
> When i opened a single file
>
> :%s/`ERROR/&SUCCESS/gc .. it works fine
>
> I want to do all files so i went to the terminal and i typed like this
> vim -c "argdo %s/`ERROR/&SUCCESS/gc | update " *.log
>
> It gives error Unmatched `
> If i removed Apostrophe "`"(left side of Keybord button 1) then it works
> fine
>
> How to proceed with this command ..Can u plz help guys .

No comments: