Bash – How to execute source command from sh file

bashbashrcUbuntu

I have file called install.sh and within this file I write something to $HOME/.bashrc file and after that I must call source command.
In terminal I can type source $HOME/.bashrc but I can't do this in bash script. If I write this to file, then I get following error:

./install.sh: 1: ./install.sh: source: not found

I am using Ubuntu 12.04 x64.

Any suggestions how to do that?

Best Answer

If you want to program a bash script, then change your shebang (first line of the script file) to

#!/bin/bash
Related Question