Re: Great SWT Program



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.)
.



Relevant Pages

  • Re: One other related Q Re: basic Q: Only one way to make vars live outside of the scope of a functi
    ... >>> directly to the calling script, without having to use global variables ... to get multiple return items from a subprocedure. ... >>> better not to mix scope and use global variables for multiple return ... before terminating the object reference. ...
    (microsoft.public.scripting.vbscript)
  • Re: Great SWT Program
    ... xterm instance for each copy of vi it launches. ... as the script blocks until each interactive process it launches ... files don't collectively exceed the command line length limit for the ... "interesting" files to some working directory instead of merely ...
    (comp.lang.java.programmer)
  • Re: Can you have a command line arg with a workbook?
    ... "Patrick Molloy" wrote: ... but I guess I would still need the multiple IF statements (or ... Case if that works in VBScript?) ... this script starts a new instance of Excel. ...
    (microsoft.public.excel.programming)
  • Re: Pattern for foo tool <-> API <-> shell|GUI
    ... The user can execute a Python script in the shell, ... There are multiple command ... where the command-line handler might look something like:: ... documentation of generate-- and any other methods that accept handler ...
    (comp.lang.python)
  • Re: script to login and run command
    ... I found out the url that launches an update doesn't require a login so ... set objExp = CreateObject ... > How can I run a script that will log into a website and launch a specific ...
    (microsoft.public.scripting.vbscript)