0

what is the use of .. in linux scripting and in the following makefile?

MODULE =  
EQUALIZER = ..  
SRCS = 

include ${EQUALIZER}/xyz.mak  
include ${EQUALIZER}/pqr.mak
Hauke Laging
  • 90,279
  • "or I am totally wrong in understanding this in a makefile?" - hard to tell really. What do you understand from this? – Mat May 15 '13 at 09:56
  • @I mean to say, that ./ is always used to run a executable file or is ../ is similar to ./ with some addition or my direction of thinking is totally wrong as i didn't get it anywhere in search. – shailendra May 15 '13 at 10:26
  • If you don't understand what . or .. means, see http://unix.stackexchange.com/questions/21847/when-you-type-ls-a-what-is-the-significance-of-and for instance – Mat May 15 '13 at 10:30
  • got it..unix.stackexchange.com/questions/21847/ cleared my doubts – shailendra May 15 '13 at 10:39
  • Without specifying a path, most shells assume that an executable is somewhere in your path. If you're running an executable that is not in your path, you have to tell your shell where the executable is by specifying a relative or absolute path to it: ./executable, ../executable, or /somedirectory/anotherdirectory/executable. –  May 15 '13 at 12:00

1 Answers1

1

Looks like this makefile includes two files (xyz.mak and pqr.mak) from its parent directory.

That seems certainly useful to me.

Anthon
  • 79,293
  • yes it certainally include xyz.mak and pqr.mak file from its parent directory but my question is why we had added .. before / or it that means when ever we need to add files from parent directory , we add .. before / ? – shailendra May 15 '13 at 10:28
  • 1
    the latter is true. .. refers to the parent directory whereever the program 'is' in the directory structure. If you would just start with / you would count from the root of the filesystem. And hardcoding a full path /abc/def/ghi/xyz.mak would mean you have to have the Makefile in a subdirectory of /abc/def/ghi/ for things to work. This make things more flexible. – Anthon May 15 '13 at 11:19
  • got this thing.Means .. and . are used to tell the path of the parent directories instead of writing the full path name – shailendra May 15 '13 at 15:16
  • 1
    . is used for the current directory, not for the parent directory. – Anthon May 15 '13 at 16:29