run file from different directory
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
Related videos on Youtube
Dchris
Updated on September 18, 2022Comments
-
Dchris over 1 year
I have a directory
mainfolder
with a subdirectoryexecution
which contains aconfigure
script. I can switch to theexecution
directory and run./configure
and it works fine. Now I'm trying to figure out how to run theconfigure
script when I'm inmainfolder
. 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?
-
nitin almost 11 years@Dchris , could you run
file /home/etc/user/mainfolder/execution/configure
and if its a script or ascii text do agrep -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. -
Dchris almost 11 years@NSD Updated result in my question
-
nitin almost 11 years@Dchris , sorry .... forgot to remove the 'file' from the grep
-
nitin almost 11 years@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
-
Dchris almost 11 years@NSD makefile.in file is located in the same directory as configure file is
-
Dchris almost 11 years@NSD What does "sed -e 's/src_pat1/replace_txt1/g' -e 's/src_pat2/replace_txt2/g' makefile.in" does?
-
nitin almost 11 yearsdo a
man sed
.... you will get all the details there.
-
-
Dchris almost 11 years$ 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 almost 11 years./configure execution didn't work
-
slm almost 11 yearsDoes 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. -
Dchris almost 11 yearswhat is tree -f?
-
slm almost 11 yearsI'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 almost 11 yearsA Unix command to list the directory structure. Almost all Unix commands (such as
tree
andls
) have what are called man pages. You can find out more about a command in your shell by typingman ls
orman tree
. Here's tree's man page: computerhope.com/unix/tree.htm. Incidentally don't try this withconfigure
, this isn't a program, it's a script that's part of the software you're trying to install. -
Mjachowdhury about 8 yearsThis doesn't do the job anyhow, does it? You end up in the execution directory as your current working directory after doing this command.
-
Mjachowdhury about 8 yearsThe actual answer is here: stackoverflow.com/questions/786376/…