[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Double quotes, single quotes



Dr Beco wrote:
> I can't seem to find the correct combination of quotes to run this command:
> 
> $vi +"r ! find . -name 'error*' -printf '%f\n'" themain.c
> 
> Is there a way to achieve this (using bash)?

The problem you are hitting is that vim is expanding the % itself and
isn't passing it to bash nor on to find.  It isn't related to quoting.
It is related to vi's percent expansion.  Use something other than
percent to avoid the problem.  In vi the '%' is replaced by the
current filename.  That is traditional vi behavior.

For 'find' you can use the default -print case by not specifying anything.

  vim +"r ! find . -name 'error*'" themain.c

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: