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?
#!line#!/bin/sh? or#!/bin/bash? – Sergiy Kolodyazhnyy Aug 25 '15 at 19:38shandbashsupport.as a name forsourceeg. ./install.sh– ctrl-alt-delor Aug 25 '15 at 19:43.is POSIX, so thesourcemight be the problem here (if it is not run underBASHbut ratherSH). – FelixJN Aug 25 '15 at 19:45.is POSIX compliant, whilesourceis not. So in case he tries to source the file via thesourcecommand but is doing so withSH, he will fail. Did that clarify it? – FelixJN Aug 25 '15 at 20:19butshould be followed by a comma (,). The phrase before the comma, should may sense on its own: be a valid sentence. – ctrl-alt-delor Aug 25 '15 at 21:33.bashrcfrom a script..bashrcis meant to be executed only in interactive environments; it's for setting up terminal parameters, prompts, completion, etc. Don't set environment variables in.bashrc. What are you really trying to achieve? – Gilles 'SO- stop being evil' Aug 25 '15 at 23:44