Re: Great SWT Program
- From: twerpinator@xxxxxxxxx
- Date: Thu, 15 Nov 2007 13:33:51 -0800 (PST)
On Nov 14, 12:46 pm, blm...@xxxxxxxxxxxxx <blm...@xxxxxxxxxxxxx>
wrote:
I've written myself a little shell script that makes it easy to
start up vim on only the files that contain specified text
That has one obvious problem: you can't launch multiple interactive
apps simultaneously in the same terminal. Another place where using a
non-GUI system runs you smack into a severe disadvantage. Unless you
"cheat" and use an xterm while somehow making the script spawn a new
xterm instance for each copy of vi it launches. Without some such
trickery, you'll just get a single vi session open to the first file.
Then when you exit vi will promptly relaunch on the second file, and
so on, as the script blocks until each interactive process it launches
is terminated, then continues. That might be good enough for you,
depending, but if you wanted to flip between several of the files to
compare stuff or whatever you'll have a problem. :)
If vi supports multiple documents, and launching with multiple files
specified on the command line, you might manage to get a single vi
with all of the files open in it at once IF the paths to all those
files don't collectively exceed the command line length limit for the
shell, whatever THAT is. For a large number of files you'd probably
hit some such limit and either get nothing or a vi session with only
some of the files open. Of course you'd then be stuck with primitive,
awkward, and annoying pre-GUI methods of switching among open
documents...
(I've had occasion to mass-select 80-odd text files and double click
one of them, producing 80 shiny new Notepad windows, and check for a
particular thing in each one before closing it. Easy as pie, and fast
too. Probably a script could be written to do something like that and
just output a list of files that didn't have the trait in question,
but writing and testing and running it would have taken much longer
than just doing what I did. If it had been 80,000 files, though, I'd
obviously have been cracking open the MS-DOS manual and writing a .bat
file. :) There'd still have been the issue of what to do with the
output if it was large enough. Change the script to move or copy the
"interesting" files to some working directory instead of merely
listing them, then go there and work with them after rerunning the
script, I suppose.)
.
- Follow-Ups:
- Re: Great SWT Program
- From: blmblm
- Re: Great SWT Program
- From: Steve Wampler
- Re: Great SWT Program
- From: Owen Jacobson
- Re: Great SWT Program
- From: Bent C Dalager
- Re: Great SWT Program
- References:
- Re: Great SWT Program
- From: Wildemar Wildenburger
- Re: Great SWT Program
- From: nebulous99
- Re: Great SWT Program
- From: Tristram Rolph
- Re: Great SWT Program
- From: blmblm
- Re: Great SWT Program
- Prev by Date: Re: enums, using methods as initializers
- Next by Date: Re: Great SWT Program
- Previous by thread: Re: Great SWT Program
- Next by thread: Re: Great SWT Program
- Index(es):
Relevant Pages
|