364,111 Members | 2129 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Check if files specified in java -classpath exists or not

MIRRA
P: 1
Hi

I have a UNIX script which creates a report. In that script I have to define the java classpath. Also I need to check if the java classpath specified exists or not. Below is the command i use

XY=./abc/cde:./bgh/nkl
# check if path defined in $jXY exists
IFS=:
for i in $XY
do
if [ -f $i ]
then
echo $i
else
exit
fi
done
java -classpath.:$XY <parameters to create report>

When i run this without checking whether path exists or not, the report is generated, but when i include the statements to check for existence of path in $XY, i am getting the error "./bgh/nkl is missing the manifest file entry"
But it actually has the manifest entry. I want to know how the check for existence of path can affect the generation of report in the java -classpath statement.
Feb 4 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Help answer this question



Didn't find the answer to your Unix / Linux / BSD question?

You can also browse similar questions: Unix / Linux / BSD