You are not logged in.
Hi everyone,
I am trying to follow this wiki. My purpose is to set fish as default shell via .bashrc. Recently I added comment to this section that it will not work for scp but was deleted and I do not understand why. The comment in wiki history says:
Remove warning about scp failing. That is due to people source bashrc (which is for interactive shells) from bash_profile (for login shells).
I tried not to source bashrc in .bash_profile, but scp still fails. Can anyone explain how can I setup fish from .bashrc without breaking scp?
Many thanks,
Jozef
Last edited by jozik (2018-02-14 09:35:45)
Offline
If I run "exec fish" from .bash_profile everything works fine, but wiki says it should be run from .bashrc
Offline
This discussion belongs into the wiki, not the forum. You might want to address the author of the changes.
However: "I tried not to source bashrc in .bash_profile" isn't very convincing and you certainly should not.
If executing fish only works from bash_profile but not from bashrc, you're not starting an interactive (bash) shell.
I will however say that I find that entire article weird ("absurd") itfp. - you certainly do not want /bin/sh to resolve fish, but what's configured as your user shell should frankly not matter.
If you have any worries, you could also just alter the way you invoke your VTE (xterm, rxvt, konsole, ...) to execute fish (but oc you'll loose a wrapping bash context - whatever that seems to be good for)
Offline
you certainly do not want /bin/sh to resolve fish, but what's configured as your user shell should frankly not matter.
Agreed. That section of the wiki really doesn't make sense at all. The default shell for your user couldn't possibly break any scripts, that's just nonsense.
you could also just alter the way you invoke your VTE (xterm, rxvt, konsole, ...) to execute fish
The OP did say this was for a system they ssh into, so the VTE isn't relevant here.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
seth wrote:you certainly do not want /bin/sh to resolve fish, but what's configured as your user shell should frankly not matter.
Agreed. That section of the wiki really doesn't make sense at all. The default shell for your user couldn't possibly break any scripts, that's just nonsense.
They *might* have been confusing "shell scripts" with "shell configurations like /etc/profile.d/" but the article is confusing enough I couldn't possibly guess one way or another.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
That would actually make quite sense....
Since fish doesn't support much of the bash syntax, notably not exporting environment vars with "FOO=bar" it'll fail to source /etc/profile.d/bag_of_bashism.sh, but can inherit the environment from a parenting process.
@jozik
You need to elaborate on the problem. What you're trying to do and what kind of error you receive. Also your bashrc and bash_profile would be of value.
---
@Trilby, I see "scp", but not "ssh"
Offline
@Trilby, I see "scp", but not "ssh"
The title seems to make it pretty clear: this is for the login shell on a server, not the local machine.
As for /etc/profile.d/* that could be a problem. But I never source those anyways. Any content of /etc/profile.d/ that would be of value should be trivial to translate to fish which would seem to be a far cleaner approach then running a turducken shell just to set a few environment variables (that may not even be needed for anything).
Last edited by Trilby (2018-02-14 15:42:13)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
That would actually make quite sense....
Since fish doesn't support much of the bash syntax, notably not exporting environment vars with "FOO=bar" it'll fail to source /etc/profile.d/bag_of_bashism.sh, but can inherit the environment from a parenting process.
But bash has nothing to do with anything. /etc/profile.d/*.sh is meant to be strictly POSIX sh. Which, then again, fish does not support either...
Then too, there is absolutely nothing stopping people from porting that to /etc/profile.d/*.fish except for the fact that fish is such a sucky shell no one has bothered.
We do in fact include several *.csh equivalents, which a csh shell can use by sourcing /etc/profile.d/*.csh and there is nothing stopping weirdo fish users from doing the same.
Last edited by eschwartz (2018-02-14 15:43:47)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Just playing the /etc/profile.d theory on
In Arch, some shell scripts are written for Bash and are not fully compatible with fish.
But yes, indeed. FOO=bar is no bashism (but originates in ksh and is now POSIX since a while) - and still not supported by fish.
Offline