Thursday, January 27, 2011

Re: Problem with APostrophe

On 28/01/11 4:22 PM, ZyX wrote:
> 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.

Like this:

vim -c "argdo %s/\`ERROR/&SUCCESS/gc | update " *.log

or this:

vim -c 'argdo %s/`ERROR/&SUCCESS/gc | update ' *.log

I encourage you to include more specific examples of your solutions,
ZyX. Your reply was/is spot on, but a little hard to understand by
somebody who doesn't know the answer already. ;-)

Ben.

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

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: