[LUAU] Windows shortcut equivalent in Linux
Tom_Gordon/RISE/HIDOE at notes.k12.hi.us
Tom_Gordon/RISE/HIDOE at notes.k12.hi.us
Tue May 18 16:53:44 PDT 2004
you could cd ~ as long as the script cds back to your previous directory,
correct? like foo=`pwd`;cd ~;echo 'hello from '`pwd`'!';cd $foo
i'm still a bit confused but here i go:
1) put your executable in a directory in PATH so you can run it from
location
2) reffer to your settings file relative to home ~/Parse/Linux/file
but i see your data file is the same as your user name so maybe
~/Parse/Linux/file`whoami` is what your after.
i also see that you want to run executibles and read data from one user to
other users on the system. perhps your script is better off in
/usr/local/bin and your data file in /etc (if it doesn't change, then
again, why would it even exist if it didn't?)
=\
"Vikram Khurana" <vkhurana at mail.nmfs.hawaii.edu>
Sent by: luau-bounces at lists.hosef.org
18/05/2004 12:30 PM
Please respond to Linux/Unix Advocates/Users Hawaiian community discussion
list
To: <luau at videl.ics.hawaii.edu>
cc:
Subject: RE: [LUAU] Windows shortcut equivalent in Linux
Sorry I didn't explain my question well enough. I can't do a cd ~ in the
script, because I don't want to change the directory I'm in
I have a file called Parse.ui in the /home/xyz/Parse/Linux directory
Parse.ui is a Perl Tk application which runs by doing ./Parse.ui in the
Linux directory. When I run Parse.ui, it reads a parameter file called
xyz.dat in the /home/xyz/Parse directory(I can move this to the
/home/xyz/Parse/Linux directory if needed) . Now I want to run this
application from different directories say /home/data/trial1/abc
Anyway to do this?
-----Original Message-----
From: luau-bounces at lists.hosef.org [mailto:luau-bounces at lists.hosef.org]
On
Behalf Of MonMotha
Sent: Tuesday, May 18, 2004 10:50 AM
To: Linux/Unix Advocates/Users Hawaiian community discussion list
Subject: Re: [LUAU] Windows shortcut equivalent in Linux
Vikram Khurana wrote:
> Hi,
>
> I want to run a program that resides in a particular directory, say
> /home/Parse
> When the program is run it reads some files in the /home directory using
a
> relative path ../<file name>
>
> I want to run this program from other directories without having to copy
the
> program & required files to those directories.
>
> I have tried using symlink, but that does not read the files in /home
> I can't seem to figure out how to do this using an alias either.
>
> In windows I create a shortcut & that runs from anywhere I place the
> shortcut. I essentially need the same functionality in Linux.
>
> Can someone please tell me the best way to solve this.
>
> Thanks,
> Vikram
>
That's not a bug, that's a feature :)
Seriously, that's a feature. In Unix, every application has it's own
working directory which is whereever it is started from, unless the app
changes that. All relative paths are derrived from that working
directory. Normally this is a good thing, but in your case, I guess
it's not.
From the sound of it, this "Parse" is a shell script. The quick fix is
to place a "cd ~" at the top to make it's current working directory your
home directory (be aware that if other people run it, it will use THEIR
home directory, not yours). The proper way is to use absolute paths any
time you want to reference a file absolutely.
Windows actually has this convention as well, though I think there may
be an option in the "shortcut" properties to set the working directory
for these (broken) applications.
--MonMotha
_______________________________________________
LUAU at lists.hosef.org mailing list
http://lists.hosef.org/cgi-bin/mailman/listinfo/luau
_______________________________________________
LUAU at lists.hosef.org mailing list
http://lists.hosef.org/cgi-bin/mailman/listinfo/luau
More information about the LUAU
mailing list