My login shell is Fish, but I would like to execute a shell command (apt install ...) as if my login shell was Bash.
Is it possible to make a command/subprocess believe that my login shell is /usr/bin/bash without actually making it my login shell?
Here is the context. When I try to install a certain package with apt install, the post-installation script fails to start some service, and there is an error message from fish about wrong syntax:
fish: Variables cannot be bracketed. In fish, please use "$XDG_RUNTIME_DIR". XDG_RUNTIME_DIR="/run/user/$UID" DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTI ME_DIR}/bus" systemctl --user start gpa I tried executing apt install from Bash, but this did not help. However, if I change my login shell to Bash, then the installation succeeds without errors.
Of course, I do not want to change the login shell back and forth to execute one command, I hope there is a more appropriate solution. (Of course, I do not understand why the post-installation script blindly uses the login shell which is not good for it.)
P.S. The package I was installing is GlobalProtect_deb-6.2.1.1-7.deb for Palo Alto GlobalProtect VPN. Some versions are available online, for example here: https://myport.port.ac.uk/connect-to-the-vpn-on-your-linux-device
/etc/passwd, say, but that wouldn't be any easier. Or if you can show what it specifically is doing that causes the error, we can try to find other workarounds.SHELL=/bin/bash your-commandmight be all that is needed. Doesn't change your login shell but that's the variable that commands usually check to know which is your preferred shell. It's itself initialised from your login shell.SHELL=/usr/bin/bashwhile executing from Bash. Did not help. I suppose I should follow the advice of @muru and complain somewhere...