I recently inherited a Ubuntu Hardy box that acts rather funky out-of-the-box. The first things I tried to do was edit my .bashrc profile to do some coloring and add some aliases I usually have, but then when I try to source the ~/.bashrc I get sh: source: not found
and I have also noticed tabbed autocomplete is also not working at all - I believe this is called bash_completetion, but as I'm sure you can tell, I'm not an expert.
Are there any specific files I should be editing to get this basic functionality I am accustomed to out-of-the-box? and isn't it unusual for the source command to not be installed?
General thought process:
Use ps
to confirm you're actually using sh
not bash
confirm that /bin/bash
exists and works properly (and [re]install it if it doesn't)
use chsh
to change your login shell to bash
install the bash-completion package if it's missing
You should be getting bash: source: command not found
(except that bash will never fail to find source
, of course). If you get sh:
, then you're either not running bash at all, or running bash with the flag that tells it to pretend it's the Bourne shell /bin/sh
. Type bash
to get a real bash, or edit the startup configuration so that it doesn't pass that flag for you (not sure where they are in Ubuntu).
Ubuntu servers sometimes have /bin/sh as the default shell. This is consistent with the issue you posted, as /bin/sh does not have the source command available. If you are noticing missing bash features, it might be possible that you aren't in bash. Here are the steps to follow, and something to remember whenever you log on to a new *nix box:
echo $0
cat /etc/shells
/bin/bash
in the list if you want to use bashapt-get install bash
(Ubuntu/Debian specific)exec /bin/bash
chsh -s /bin/bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With