Use alias source with relative path
- by notme
I want to add an alias file to my project folder to quickly open and edit files in it with a simple shell command.
To make it more portable, I would like to use only relative paths.
I want something like this:
### .profile
source /my/project/folder/aliases.bash
and
### aliases.bash
editprojectfiles="edit [/my/project/folder/]afile.txt"
The problem for me now is how to retrieve [/my/project/folder/] automatically.
I tried to use $PWD variable, but the result is that the alias points to the folder of .profile file and not the aliases.bash ones.
Is there a way to get this?