From: Phil Romero Date: 2010-01-27T19:18:52+09:00 Subject: Re: Why does `source .bashrc` complain "command not found"? --001636e0b7279c5ab2047e22baa0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 27, 2010 at 2:04 AM, Ammar Ali wrote: > 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 > > > Another good tool to use is 'type' when trying to puzzle this stuff out: [pdr@grace]$ type source source is a shell builtin [pdr@grace]$ type . . is a shell builtin --001636e0b7279c5ab2047e22baa0--