Scripting Hack to auto-fill classpaths
How to add a load of jars recursively below your current directory to the classpath without pain, unless you like pain?
First you use 'find' to generate a list of jars
find . -name '*.jar'
Then you pipe the result through something which first turns newlines into colons, then chops the trailing colon off - this chain.
tr '[:space:]' ':' | sed -e 's/:$//g'
The output of this, you can use as part of a java invocation, by incorporating the output into the command using backticks such as...
java -cp `find . -name '*.jar' | tr '[:space:]' ':' | sed -e 's/:$//g'` net.sf.saxon.Query
Alternatively you can output the result into a file, and incorporate it using cat, which is a bit shorter and more consistent.
find . -name '*.jar' | tr '[:space:]' ':' | sed -e 's/:$//g' > classpath
java -cp `cat classpath` net.sf.saxon.Query