Dumb Intern Dumb Intern - 1 year ago 57
Linux Question

How does ${path} work, in this tutorial

I'm sure this is one of the dumbest problems asked on this site, but I am very new to linux, and a little out of my depths. I'm working off of this tutorial here and am stuck on the "add the path" and verify steps.

For this one the tutorial told me to use this:

export PATH=${PATH}:${DTITK_ROOT}/bin:${DTITK_ROOT}/utilities:${DTITK_ROOT}/scripts

I have already defined DTITK_ROOT, and have a few questions about the above instructions.

  1. Should the ${} be left around the DTITK_ROOT?

  2. My DTITK_ROOT is the full path (I think that's the right term) to the file I extracted the program to, should I change that?

  3. What do I write for ${PATH} in that case? I understand that I'm supposed to replace it with something, but I don't know what. Everything I've tried doesn't pass the verify step.

I'm sorry if it seems like a dumb or really simple question, but I don't even know any keywords to google in order to find how to get the answer.

Answer Source
  1. Yes. This is how you access the path stored in DTITK_ROOT. This is called parameter expansion. You can read more about it here.

  2. No, don't change anything. Also, a more commonly used term is absolute path, in comparison to relative path. The absolute path is a path from the root directory, /. Relative path is a path from your current working directory. You can read more about paths in general and the difference between absolute and relative paths here.

  3. You don't replace it with anything. Once again, parameter expansion comes into play and this will be replaced with what is already stored in your path variable. So really all this command is doing is taking your path variable, adding some more paths to it, and then storing it back into your path variable. If you didn't know, the path variable contains paths to all executable files that you would like to execute without typing the full path. Here is a good discussion on path variables, along with other environment variables.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download