

We will usually get this error as “source: command not found” or, if we are using sudo, as “sudo: source: command not found”, in both cases the problem is that the shell session is expecting us to run a program, but remember that source is not a program, we are actually running a bash built-in like previously explained. So, if we do something wrong while using source we may get errors, and one of them will be Source command not found, of course, so let’s see what causes this error.

This can be very useful in some situations, we can do even more with source, though that is not the point of this article. Once that is done, we can use source to alter the environment of the script we run and make it be our current environment, which will make the new variable available for the script we are running. Well, source will solve that for use if we need to use some custom variables.įirst, we will need to define a variable in our current shell environment. Most of the time when we run a script on Linux it will run in a subshell, and thus will not run in the same environment as our current shell session. If we want to change some variables to, for example, run a script, then the best way to do that is to use source. These variables are fine for most tasks, but for others, we may need to make some changes, and that is where the source command enters the stage. Every time we open a new SSH session on a Linux system the shell automatically loads some default variables. To understand what it does, first, we need to know what shell variables and environment variables are on Linux.
OS X SHELL SCRIPT COMMAND NOT FOUND SOFTWARE
Source is a built-in command, it is part of the bash software package.
OS X SHELL SCRIPT COMMAND NOT FOUND HOW TO
In this article, you will learn what is source, why this error happens and of course, you will also learn how to solve it, so if you are getting the error source commando not found on your Linux system please keep reading.įirst off, what is the source command exactly? It is important to state that source is not an actual Linux software package, it is not a proper program as, for example, du, egrep, find, etc. This error is source: command not found, and today we are going to explain to you everything that you need to know about it. Many times when we are working on Linux we have come across a pretty common error regarding source.
