I have a script that needs sudo permissions and needs to be run with /bin/bash
on an Ubuntu 14.04 machine.
If I run it while logged in as root (or any other user) it opens with /bin/bash
as expected, however when I run the script with sudo
it opens with /bin/sh
no matter what user I'm logged in as.
I've checked /etc/passwd
and I see /bin/bash
is the default shell for root. $SHELL
is defined as /bin/bash
as well.
I won't be the only one using the script, so I can't rely on people using sudo -i
to run it.
Where is the sudo shell defined? How can I change it?
#!/bin/bash
#!/bin/bash
in the script but not as the first line! I had some comments about the script beforehand, old python habits I guess. I've changed their order and the script opens with bash! Thanks. I can't upvote your comments :/