| Author |
vi editing multiple files in nested directories
|
|
| sshikari@hotmail.com 2006-11-25, 7:21 pm |
| I would like to edit all files of a certain type in all nested
directories using vi. I am using a version of vi that supports tabs..
so if I am in a certain directroy and type:
cd ruby
vi -p *.rb
it opens all of the .rb files in that directory in seperate tabs.
The problem is that there are .rb files in subdirectories within the
"ruby" directory and I'd like to open all of the .rb files from that
directory down.
I tried:
vi -p */*.rb but that only goes 1 level down.
Searched around for a while and couldn't figure this one out. Any help
would be appreciated.
| |
| sshikari@hotmail.com 2006-11-25, 7:21 pm |
| I played around and got it to work with:
vi -p `find . -name *.rb -print` &
sshikari@hotmail.com wrote:
> I would like to edit all files of a certain type in all nested
> directories using vi. I am using a version of vi that supports tabs..
> so if I am in a certain directroy and type:
>
> cd ruby
> vi -p *.rb
>
> it opens all of the .rb files in that directory in seperate tabs.
>
> The problem is that there are .rb files in subdirectories within the
> "ruby" directory and I'd like to open all of the .rb files from that
> directory down.
>
> I tried:
> vi -p */*.rb but that only goes 1 level down.
>
> Searched around for a while and couldn't figure this one out. Any help
> would be appreciated.
| |
| Bill Marcum 2006-11-25, 7:21 pm |
| On 25 Nov 2006 14:17:41 -0800, sshikari@hotmail.com
<sshikari@hotmail.com> wrote:
> I would like to edit all files of a certain type in all nested
> directories using vi. I am using a version of vi that supports tabs..
> so if I am in a certain directroy and type:
>
> cd ruby
> vi -p *.rb
>
> it opens all of the .rb files in that directory in seperate tabs.
>
> The problem is that there are .rb files in subdirectories within the
> "ruby" directory and I'd like to open all of the .rb files from that
> directory down.
>
> I tried:
> vi -p */*.rb but that only goes 1 level down.
>
> Searched around for a while and couldn't figure this one out. Any help
> would be appreciated.
>
vi -p $(find . -name '*.rb')
--
Psychiatry enables us to correct our faults by confessing our parents'
shortcomings.
-- Laurence J. Peter, "Peter's Principles"
|
|
|
|