Script startup directory in Fish shell

I am trying to start SBT using the Fish shell. The following is the equivalent of the Bash script of what I'm trying to achieve:

java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"

In the Fish documentation, I see that $@in Bash you can replace with in $argvin Fish. But I do not see what to replace dirname $0with.

Does anyone know the equivalent script in Fish?

+5
source share
2 answers

$ _ seems to work directly through the reader / command line, or when a script is used for me.

Maybe this will work for you:

java -Xmx512M -jar (dirname (status -f))/sbt-launch.jar "$argv"      # fish
+5
source

fish equivalent to this:

java -Xmx512M -jar $(dirname $0)/sbt-launch.jar "$@"     # Bash, et al

is an

java -Xmx512M -jar (dirname $_)/sbt-launch.jar "$argv"      # fish
+1
source

All Articles