It's hacky, but you could read /proc/$PID/cmdline. It's a NUL-delimited
file containing the entire commandline used to start the process. Then you
can use readlink -f to find the absolute path. If the first element
resolves to the path of fish, the second should resolve to the path of the
script.
I can't seem to get $_ to output the name of the script. Sometimes
it's blank, and sometimes ".".
For example, "echo $_" in my ~/.config/fish/config.fish outputs a blank line.
Some other experiments:
$ echo $FISH_VERSION
2.0.0
$ cat foo.fish
echo $_
$ fish foo.fish
[blank line]
$
I've installed rvm.fish :
yt at GERICOM in ~
↪ cat .config/fish/functions/rvm.fish
function rvm -d 'Ruby enVironment Manager'
# run RVM and capture the resulting environment
set -l env_file (mktemp -t rvm.fish.XX)
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; e
Try $_
from http://fishshell.com/docs/2.0/index.html#variables
On Tuesday, June 11, 2013, Michael Stillwell wrote:
> Is there a fish equivalent of $0 (the full pathname of the running
> script)? (Or indeed any way to determine what directory a script is
> in, from within the script itself?)
>
>
Is there a fish equivalent of $0 (the full pathname of the running
script)? (Or indeed any way to determine what directory a script is
in, from within the script itself?)
Michael
--
This SF.net email is sponsored by W
I've just noticed some odd behaviour around previous command completion
on Ubuntu 12.04 with the apt-get fish package (2.0.0).
When the greyed our part of the command makes the command longer that
the available space the greyed out part shows '...', and when the typed
part of the command is too
Hi Dario
It looks good, if it was around when I started using fish I definitely
would have used it.
When I moved to fish I made a custom workon script but got bored of
updating it every time something changed or I had to customise it in a
different environment. Eventually I gave up and now jus