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

Re: [soot] compiling multiple class files



Thanks.
I'm illiterate as concerns shell scripting, and I hope to remain so for ever.

-:)
 

John Plond JORGENSEN wrote:

>>>>> "philippe" == Philippe Laporte <philippe@transvirtual.com> writes:

    philippe> Hi, thanks Feng.

    philippe> But starting a process all the time, especially for
    philippe> large bunches of classes, like Kaffe's Klasses.jar,
    philippe> is slow.

Here's a variant on Feng's script that only starts two extra
processes (The original question, for those who came in late, was
" How to instruct soot to optimize all (unrelated) classes in a
directory? The command should override old classes."):

    #!/bin/bash
    DIR=$1
    shift

    cd $DIR
    classes=`echo *class | sed -e 's/\.class / /g' -e 's/\.class$//'`
    java soot.Main $* $classes

The `...` shell construction executes ... in a subshell, then
substitutes its output in the surrounding text.  There may be
some way to do the text substitutions without starting sed, but I
was too lazy to look for one in the bash man page.

--
John Jorgensen          jjorge1@cs.mcgill.ca

-- 
Philippe Laporte                      Tel:     (415) 243-4055 ext 1011 
Transvirtual Technologies, Inc.,      Fax:     (415) 243-4056
San Francisco, CA, USA.               Email:   philippe@transvirtual.com