views:

44

answers:

1

I have a shell script file to run jar on Linux O.S which contains

#!/bin/sh
#MyApplication
MyApplication_home='/Desktop/MyApplication'
chkpath="$MyApplication_home/jre6/bin/java"
if [ -e $chkpath ]
then
export PATH=$MyApplication_home/jre6/bin:${PATH}
export CLASSPATH=$MyApplication_home/MyJar.jar:${CLASSPATH}
java -Xmx512M -jar MyJar.jar $1 $2 $3 $4 $5
else
echo "Path $MyApplication_home not found"
echo "Edit MyApplication_home to specify full PATH of MyApplication home directory"
fi

When i run this shell script onto terminal with arguments my application get boot.

Now my requirement is :-

I would like get the name of files that has been dropped onto the shell script file and would like to pass the name of that dropped file as an argument to my jar and my application get boot.

(we would like the user to be able to pick a file from Linux file system and drag & drop it to shell script and that make it boot the jar )

I have implemented this on Windows with the help of batch file and MAC O.S. using apple script and would like to implement in Linux O.S.

A: 

It depends on the Terminal and especially the Window Manager you are using.

I know this can be done in KDE and I'm pretty sure it can be done in Gnome and others Window Managers.

cb0