Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a directory mainfolder with a subdirectory execution which contains a configure script. I can switch to the execution directory and run ./configure and it works fine. Now I'm trying to figure out how to run the configure script when I'm in mainfolder. I tried:

./configure /execution

and:

./configure execution

but neither worked. I also tried the same thing using the full path either starting from root directory or from user directory like this:

./configure /home/etc/user/mainfolder/execution
./configure user/mainfolder/execution

I always got the message:

bash: ./configure: No such file or directory

Finally, I tried:

/home/etc/user/mainfolder/execution/configure 
. /home/etc/user/mainfolder/execution/configure

Both gave me the error:

sed: can't read makefile.in: No such file or directory

How can I do this?

share|improve this question

closed as not constructive by slm, Anthon, vonbrand, jasonwryan, Renan Jun 10 '13 at 12:50

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
@Dchris , could you run file /home/etc/user/mainfolder/execution/configure and if its a script or ascii text do a grep -A5 -B5 "sed" file /home/etc/user/mainfolder/execution/configure and paste the result here ? ..... it might be that the makefile.in which i think sed is supposed to make change/update to might be missing or the path might have been changed. This was we can confirm it. –  nsd Jun 9 '13 at 9:38
    
@NSD Updated result in my question –  Dchris Jun 9 '13 at 9:52
    
@Dchris , sorry .... forgot to remove the 'file' from the grep –  nsd Jun 9 '13 at 9:53
    
@Dchris ,thank you .. the sed command is substituting some values from/to the makefile.in descriptor file .... the makefile.in seems to be mentioned a bit below in the command than what has been reported back by the grep command ..... you would need to locate that makefile.in and change the path/location so that it is accessible in the /home/etc/user/mainfolder/execution/configure directory then it should work fine –  nsd Jun 9 '13 at 9:56
    
@NSD makefile.in file is located in the same directory as configure file is –  Dchris Jun 9 '13 at 10:01

3 Answers 3

First confirm that the configure script is present where you think it is. Second make sure that it's executable:

$ ls -l ./configure 
-rwxrwxr-x 1 saml saml 100 Jun  9 05:11 ./configure

If both of the checks are OK then you might want to try running configure by first changing directories to /mainfolder/execution and then running configure like this:

$ cd /mainfolder/execution
$ ../configure

You also might want to try it this way:

$ cd /mainfolder
$ ./configure execution

EDIT #1

According to comments left by OP, the following directory structure appears to be what he's describing:

$ tree -f
.
`-- /mainfolder
    `-- /mainfolder/execution
        `-- /mainfolder/execution/configure
share|improve this answer
    
$ ls -l ./configure command is ok when i run it in execution directory but when i run it in mainfolder directory i have the message "ls:cannot access" –  Dchris Jun 9 '13 at 9:23
    
./configure execution didn't work –  Dchris Jun 9 '13 at 9:37
    
OK, so what you're telling us is that the configure script is present in the directory /mainfolder/execution and not in the dir. /mainfolder. This would explain why you can't run configure from the /mainfolder, it isn't located where you think it is. –  slm Jun 9 '13 at 13:27
    
Does my edit reflect what dir. structure you have? If this is correct, then you can't run configure the way you've been trying to. –  slm Jun 9 '13 at 13:32
    
what is tree -f? –  Dchris Jun 9 '13 at 13:34

In *nix / always is the root directory of the whole file system and . always refers to the current working directory.

Every path starting with / is an absolute path. Every path starting with . is a relative path.

Hence /home/... is probably correct, as this directory lives it the root directory, whereas /excecution is probably wrong as this directory does not live in the root directory, but somewhere under /home/....

If you say ./configure, you try to run the file configure living in the current working directory (.).

The error No such file or directory, well, just says that there is no file named configure in the current working directory.

You can use pwd to show, what the current working directory is. Use ls to show what files exist there. Use cd to change the current working directory.

To help you with your actual problem. You need to say what you were trying to do. Why do you want to run configure? What is it supposed to do? Why do you think you need to specify the execution directory?

share|improve this answer

The problem is that I have to run the file but don't change my current directory. So I tried this and worked:

cd execution/ && ./configure
share|improve this answer
2  
I'm glad you were able to solve you issue but in the future, please try and ask your question correctly and give accurate information. I realize this might be difficult given your new to Linux, but your question and all these answers is of little value to the Unix & Linux site as a whole. As you refine your question through comments and your own research feel free to update and refine your question. At this point you've wasted a lot of peoples time and left a bit of a mess here now with this useless question. I don't mean this in a rude way at all, I'm just trying helping you to understand. –  slm Jun 9 '13 at 13:42

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