The variable $PATH is what it is and why you need?

in a variable
$PATH
you can add paths , but what is it ? array with data or is concatenating to a string ?
June 8th 19 at 17:14
3 answers
June 8th 19 at 17:16
An array of strings essentially.
Separated by ":" (in Windows - all is similar, only separated by ";")

Used when the program runs primarily (and sometimes for other things)
List of directories where it will be searched for the program, if not found in the current directory.

Is just a string. One line.
But some GUI-shnye utility when editing, divide it into separate elements. For easy editing.
if not found in the current directory.

In Linux the current directory in the PATH is not included. - chaz commented on June 8th 19 at 17:19
,

In Linux the current directory in the PATH is not included.


I have somewhere written that the PATH includes the current directory?
You probably meant the form "./somefilename" - efrain.Rolfso commented on June 8th 19 at 17:22
,
if not found in the current directory
- chaz commented on June 8th 19 at 17:25
in Linux, the current default directory is not searched.
Many simply add it to the PATH itself thus:
PATH=.:$PATH - Jeff28 commented on June 8th 19 at 17:28
June 8th 19 at 17:18
This is a normal string variable.
In Linux there is only
numeric variables: $VARIABLE
string variables: $VARIABLE
arrays: $VARIABLE[x]

all.
PATH is a regular string variable whose values are separated by a colon.

It a list of directories in which to look for executable file, if you are in the command prompt, do not write full path to it.
June 8th 19 at 17:20
that is why the scripts from a directory not listed in PATH, as well, and executables should be run like so: ./filename with a dot and a slash. This means to run the file from the current directory. If this is not done is, first, do not want to search this file in all the directories specified in $PATH, and second, in the case of complete coincidence the name of the executable file, the system will not start the desired file from the directory and such in directories of $PATH

Find more questions by tags Linux