Create account / Log in

No Title

Topics related to the main Vassal engine.

Moderators: uckelman, Tim M

No Title

Postby uckelman » December 1st, 2008, 2:07 pm

Thus spake "IrishBouzouki":
I think since this is using a -classpath command the classpath MUST be being
set, and the problem lies in that the cd is NOT going to the location of the
script but remaining on the desktop where the icon is located that has the sh
ortcut to the VASSAL.sh file.

First, note that '.' refers to the current directory, and that relative
paths are relative to the current directory. Therefore, there is no
difference between './lib/Vengine.jar' and 'lib/Vengine.jar' for the
purposes of specifying a path.

what is the following actually supposed to do and how?

cd `dirname "$0"`

Here's how to read this:

The backticks (`) cause whatever they enclose to be run in a subshell, after
which the output of that is substituted in place of what was enclosed in
backticks. That is, 'cd `dirname "$0"`' is equivalent to 'cd FOO', where
FOO is whatever you get when you run 'dirname "$0"'.

In the bash shell, $0 is a variable which holds the path of the script which
is currently running, or the name of your shell if no script is running. You
can see this yourself by typing 'echo $0' in your shell. In the context of
this script, $0 will be the script's path. In your case, this will be
something like '/home/john-murphy/VASSAL-3.1.0-beta6/VASSAL.sh'.

The dirname command takes a path as an arugment, strips off everything from
the last '/' to the end, and returns as output what's left. So, in your
case it should be getting '/home/john-murphy/VASSAL-3.1.0-beta6/VASSAL.sh'
as input, and returning '/home/john-murphy/VASSAL-3.1.0-beta6' as output.

Finally, the cd command changes the current directory to be whatever it
is given as an arugment. In your case, it should be getting
'/home/john-murphy/VASSAL-3.1.0-beta6' as an argument, and so will make
that the current directory.

Therefore, when the second half of the command in VASSAL.sh is run, the
current directory will be the directory which VASSAL.sh is in. If you
haven't moved VASSAL.sh, then the directory which VASSAL.sh is in will
also contain the lib directory, and in that will be Vengine.jar, which
is why the classpath is given as 'lib/Vengine.jar'.

Therefore: If you want to run VASSAL, (1) you should not need to edit
VASSAL.sh, and (2) you should not move VASSAL.sh relative to the lib
directory.

If you want to launch VASSAL from your desktop, you should have your
shortcut run VASSAL.sh. This is not the same as having your shortcut be
a copy of VASSAL.sh. The principle here is the same as with any other
program, say, Firefox. If you want a shortcut to Firefox on your desktop,
you would not copy or move /usr/bin/firfox to your desktop; rather, you
would make a shortcut which runs /usr/bin/firefox.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8789
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests