atb
atb

Reputation: 963

Make alias/link to shell script that calls relative files

I'm making a small little to-do-list command line program in Python using an SQLite3 database, and I would like to make an alias/link to the shell script that basically runs the program and put it in my ~/bin directory which has been included in my PATH.

I've tried doing ln -s ~/path-to/shell-script ~/bin but the problem is that when the script, for example, checks to see if the database file exists, it's checking ~/bin, not where the script actually resides. How do I make a link so that it references the correct directory, where the script is?

I'm not sure if I'm doing this correctly at all, so if someone could point me in the right direction it would be greatly appreciated! Thanks.

Upvotes: 0

Views: 290

Answers (1)

BitHigher
BitHigher

Reputation: 501

There is a very simple method to fix your problem, just adding the following code in the beginning of your shell

cd ~/path-to/shell-script

Hope helps!

Upvotes: 1

Related Questions