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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 _______________________________________________ [email protected] mailing list http://lists.hosef.org/cgi-bin/mailman/listinfo/luau
