Re: Feed a list of filenames to vim

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



> -----Original Message-----
> From: centos-bounces@xxxxxxxxxx 
> [mailto:centos-bounces@xxxxxxxxxx] On Behalf Of Bowie Bailey
> Sent: Wednesday, May 18, 2011 9:55
> To: centos@xxxxxxxxxx
> Subject: Re:  Feed a list of filenames to vim
> 
> On 5/18/2011 12:50 AM, Jussi Hirvi wrote:
> > On 17.5.2011 19.36, Bowie Bailey wrote:
> >> Try this:
> >>
> >> vim `cat list`
> > Thanks, this really works! I tried it with all my combinations:
> >
> > OS X workstation by itself
> > OS X workstation -> ssh -> CentOS 4
> > OS X workstation -> ssh -> CentOS 5
> >
> > BTW, with the xargs command, all of these combinations give some 
> > problems. The cause may have something to do with my 
> terminal settings.
> > Anyway, now I can use `cat list`.
> 
> The problem is that you were screwing up vim's stdin.  Using 
> the method I gave you, you are just taking advantage of shell 
> features to provide a list of filenames to vim on the command line.
> 
> If your list looks like this:
> 
> file1
> file2
> file3
> 
> Then when you do "vim `cat list`", the shell expands it to this:
> 
> $ vim file1 file2 file3
> 
> You can also do this:
> 
> $ vim `ls -1 *.txt`
> 
> or this:
> 
> $ vim `find /some/dir -name '*.txt'`
> 
> It works with any command that outputs a list of filenames.

Until you have a space in a filename.



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux