Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Shell Scripting Help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
vyom
n00b
n00b


Joined: 21 Jun 2003
Posts: 5

PostPosted: Sun Sep 05, 2004 6:50 am    Post subject: Shell Scripting Help Reply with quote

I have been trying to google this for a while, and i need it quite urgently.. so I am posting here.

I am working with Java on linux and i need to add a bunch of jar files in a folder to the classpath. The shell script that launches the Java app has to source a bunch of Jar files in a folder, say ./lib/java relative directory.

How do i append all these jar files in a single variable CLASSPATH and then subsequently launch the program.

Thanks a lot in advance..
Regards
Deepak
_________________
Carpe Diem
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Sun Sep 05, 2004 6:54 am    Post subject: Reply with quote

You mean like export CLASSPATH="/usr/lib/java/jar1:/usr/lib/java/jar2"?
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
vyom
n00b
n00b


Joined: 21 Jun 2003
Posts: 5

PostPosted: Sun Sep 05, 2004 7:07 am    Post subject: Reply with quote

Yes, but I need to do this dynamically, since I cannot keep modifying the script, and Jar files may be added at a later date.
_________________
Carpe Diem
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Sep 05, 2004 4:13 pm    Post subject: Reply with quote

You mean like this?
Code:
for F in ./lib/java/*jar
do
  CLASSPATH=${CLASSPATH}:$F
done

_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum