Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
base
   └──────install
   └──────setup
              └───myfile

Suppose this is a part of my directory structure in Unix. Is there any difference between these two:

1)

base/setup$ myfile

2)

base/install$ ../setup/myfile

I was trying to install something, and the second gave me some library dependency errors. I thought that these two methods are the same. Why is not that so?

share|improve this question
    
The best way to realise this, I think, is to write full paths: base/setup/1.sh > base/setup/myfile base/install/1.sh > base/setup/myfile –  netme Jul 30 '10 at 9:46
    
@netme: here ">" is not the redirection operator, I meant "base/setup>" as a command prompt. –  Lazer Jul 30 '10 at 10:33
1  
It would be better to include error messages or specific unexpected behavior in your question. "Did not work" provides no useful information. You may prefer ">" in your prompt, but when you show it to other people change it to "$" in order to reduce confusion. –  Dennis Williamson Jul 30 '10 at 14:17
1  
"Did not work"? Which means what exactly? –  Lawrence Velázquez Jul 30 '10 at 16:08
1  
@Lawrence Velázquez: got some library dependency errors. –  Lazer Jul 30 '10 at 19:13
show 1 more comment

2 Answers 2

up vote 6 down vote accepted

base/setup/myfile and base/install/../setup/myfile are the same file. The only explanation I can think of is that base/setup/myfile is referencing a file with a path relative to your current working directory (e.g: run ./modules/pre-setup) - in which case it may make a difference where you are when you run the script.

share|improve this answer
add comment

it may not have worked as myfile could be trying to call or use things in current directory expecting to be located in the base/setup directory but you are in the base/install directory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.