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