I have a script:
#!/bin/bash echo "$(dirname $(readlink -e $1))/$(basename $1)"
that sits here:
/home/myuser/bin/abspath.sh which has execute permissions.
If I run
echo $PATH I get the following:
I wish to be able to, from any directory, call
abspath <some_path_here> and it call my script. I am using bash, what I am doing wrong?
You want to type
abspath, but the program is named
abspath.sh. The problem is not regarding whether it is in the PATH, but the fact that you are simply not using its name to call it.
You have two options:
- Rename the program to
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.