From: Ammar Ali Date: 2010-01-27T19:04:52+09:00 Subject: Re: Why does `source .bashrc` complain "command not found"? Adam Akhtar wrote: > Thank you very much for both of your replies. I just tried > > `/bin/bash -c 'source whatever'` > > and it worked! Fantastic. > > But i don't understand if source isnt a known command then how come when > i go to my command line and type source it works fine? > > Thats why i was initially confused. It worked manually but not inside a > script or in irb. > > source is a built-in shell command, not an executable. It is only available from within the shell. When you go to your command line, you're in the shell. In a ruby script, or irb, the above works because it runs the bash shell and hands it the commands to run as a string (the -c option). Try running these: $ which bash # /bin/bash $ which source # returns nothing HTH, ammar