ql_get_latest(){
. "$BASH_SOURCE";
}
export -f ql_get_latest;
when I run bash, I drop into a shell:
and then when I run ql_get_latest I get:
bash: environment: No such file or directory
anybody know what that's about?
ql_get_latest(){
. "$BASH_SOURCE";
}
export -f ql_get_latest;
when I run bash, I drop into a shell:
and then when I run ql_get_latest I get:
bash: environment: No such file or directory
anybody know what that's about?
BASH_SOURCE(or specifically, the element at index 0 of that array) is the name of the file where a function definition occurs. Since your shell inheritsql_get_latestfrom its parent, the name of the "source file" is set toenvironment. You can see this (and another special case) if you simply echo the value of the variable from the function.In your case, you are attempting to source the file named
environment, which doesn't exist. (And if it did, it wouldn't necessarily be related toql_get_latestin any way.)