When someone says "in your path," what does this mean exactly?

1,709

Solution 1

They usually mean to

  • put your script or executable in one of the directories listed in the PATH environment variable, as shown by echo $PATH.

  • or modify said variable to contain the directory where you script/program/application is

The PATH variable contains a list of colon (:) separated directories to be searched for programs to execute. For example:

$ echo $PATH
/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games

You could put your program in e.g. /usr/local/bin, so that it will be detected by other programs without you having to explicitly tell them to look at e.g. /home/user/apps/MyApp.

Alternatively, you could modify that variable to contain /home/user/apps/MyApp. For a single bash shell session, this would do:

$ export PATH="$PATH":/home/user/apps/MyApp

To do it permanently for bash you have to enter this line (without the $ shell prompt) in ~/.bashrc or ~/.bash_profile (or both).

If you have another shell (bash is the default for most Linux distributions) the commands above should be changed accordingly.

Solution 2

Well, here is a link by LINFO (The Linux Information Project) : http://www.linfo.org/path_env_var.html

It explains to you what it is, how you get it, how you change it, well, everything you need to know about it :)

Solution 3

Path is the name of an environment variable in an operating system. Linux, Unix, DOS, Windows and other operating systems have this concept. The Path environment variable defines the folders to be searched for a command or application to be executed. Hence, if X is the folder which contains your command or application, by adding X to your Path, it allows command, scripts or applications in X folder to be executed by just typing its name alone.

Try this "echo $PATH"

To add X (e.g. /home/x) to $PATH, type

PATH=$PATH:/home/x

In Linux or Unix, folders are separated by colon (:) while in Dos, Windows, etc, folders are separated by semi-colons (;)

http://lowfatlinux.com/linux-environment-variables.html

Share:
1,709

Related videos on Youtube

Sorin
Author by

Sorin

Updated on September 17, 2022

Comments

  • Sorin
    Sorin over 1 year

    I read many answers around regarding this topic, but I couldn't find the right one for me.

    Requirements:

    1. I have 2 threads/users
    2. I have two entries in CSV Data Set Config for login.

    The number of users will always be the same as the CSV rows.

    My test looks like:

    Thread Group

    1. Homepage
    2. Loop Controller
    3. ---Login
    4. ------CSV DataSetConfig
    5. [another http call]

    If I set number of threads 2 and Loop to 2 I get in Tree:

    • Homepage1
    • Login user1
    • Login user2
    • Homepage2
    • Login user1
    • Login user2

    If I set number of threads to 2 and Loop to 1 I get:

    • Homepage1
    • Login user1
    • Homepage2
    • Login user1

    If I set number of threads to 1 and Loop to 2 I get:

    • Homepage1
    • Login user1
    • Login user2

    I also tried to put the CSV Data set in the thread group before the login call. If I set 2 users to start the flow, always pick the first row from CSV.

    What I need:

    • Homepage1
    • Login user1
    • Homepage2
    • Login user2
    • Each user should continue it's flow

    I could try to setup two Thread groups with specific user login, but it's not feasible because I want to increased the number of users and it's not maintainable. As an overview, I have 4 flows and 200 users. After I solve this problem I will think about the user variability.

    If anybody knows how to do it or can point me to the right info, please do so. Thanks a lot.

  • Johannes Schaub - litb
    Johannes Schaub - litb over 13 years
    +1 for the new (unregistered?) superuser user! Hope the transition will go fine.
  • user221931
    user221931 over 13 years
    It also depends on your shell. For BASH use 'export PATH=$PATH:/home/x' - if you don't do this then the PATH is not propogated to any other shells. For CSH 'setenv PATH $PATH:/home/y' (you may need to escape ':' as '\:'
  • Sorin
    Sorin about 10 years
    Sorry if I wasn't specific enough, Homepage call is outside CSV file. This CSV only holds the users and passwords. The flow sounds like: the user go to website homepage, do login (single session runtime) and than do something on the website. I cannot 'clone' the same user because of the session, that's why I need multiple users doing the same flow. Thanks anyway
  • Sorin
    Sorin about 10 years
    The only reason I typed Homepage1 and Homepage 2 is to have an idea what user makes that call. But it's about the same URL
  • Nachiket Kate
    Nachiket Kate about 10 years
    can you be more specific? I am confused with your needs
  • Sorin
    Sorin about 10 years
    That's the answer :) it seems I got stuck with that Loop controller and couldn't think without it. Just tried as you described and each user took it's own login credentials from CSV file. Thanks!
  • Sorin
    Sorin about 10 years
    Sorry about that, Johan B. just answered below. Thanks anyway.