To open files in Grep's output to Vim's -o -mode

前端 未结 6 982
死守一世寂寞
死守一世寂寞 2021-01-31 14:19

How can you put a list of files to Vim\'s -o -mode?

I have a list of files as Grep\'s output. I run unsuccessfully

1

grep -il          


        
6条回答
  •  鱼传尺愫
    2021-01-31 14:52

    The second one should work unless some of those filenames contain whitespace. You should do

    grep -il sid * | xargs -d "\n" vim -o
    

    if this is a possibility. -d "\n" tells xargs to use a newline as the delimiter when reading in the arguments; normally it is any whitespace (newline, tab, or space character)

提交回复
热议问题