one of my favourite things about using the fish shell is that I can just run `fish_add_path SOME_DIRECTORY` and it'll just immediately add the thing to my PATH

Now my PATH is full of a million random directories that I wanted there for some reason and honestly I love it

(also this “run a nonexistent command" trick only works for bash/zsh/fish, but my guess is that most people who are unsure about which shell they're using are using either bash or zsh)

@b0rk I've only ever used bash and zsh, so I don't know if this works on other shells, but `echo $SHELL` also works!

@scubbo the reason i didn't do that is that in my life sometimes I've had my system shell set to bash, but I've had `fish` in my .bash_profile so that I'm actually using fish as my shell. so in that case `echo $SHELL` wouldn't have worked for me

to be fair that's a kind of weird thing to do, but “what's your user's default shell set to” is not quite the same thing as "what shell are you currently using”

Follow

@b0rk @scubbo

Wouldn't `ls -l /proc/$$/exe` work always?

@ednl @robryk @b0rk @scubbo And FreeBSD's /proc doesn't have "exe" - it has "file" instead. And it seems that the fish shell doesn't have $$!

@dwmalone @ednl @b0rk @scubbo

For pure amusement, I tried to find a way to work around lack of `$$` in fish (I concede defeat to non-Linux systems being sufficiently different) and found a weird one: `readlink /dev/fd/0 < /proc/self/exe`

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.