Results 1 to 5 of 5
First - hi all! I'm new to the forums and only use Linux at work, as of now. I'm starting to learn it a bit so I don't have to ...
- 07-24-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 3
The function of ">"?
First - hi all! I'm new to the forums and only use Linux at work, as of now. I'm starting to learn it a bit so I don't have to call the tech guy in whenever I want to do something simple. I actually kind of enjoy it and might install it on a computer I'm putting together will spare parts.
Now on to the question:
I'm running Redhat and having to install a program. It's a stripped-down research program (I work for the government) that runs in the console. I had to unzip a file and now I'm learning how to do ./config and and make, etc. etc.
My question really has nothing to do with the installation process itself, but with an oddity I've noticed in typing things into the console. For example, the instructions I have to install the program say for me to go to the program's directory and type into the console:
#>make
This seems to work...I mean at least I don't get an error. However, if I just type in:
#make
RETURN: #make: *** No targets specified and no makefile found. Stop.
Why is this? What is the function of the ">" before the "make"? I thought make was just a program that runs from bash, kind of like "ls" or something. In that case, why do I get an error when I don't have the ">" before typing make? My only guess is that the ">" tells the make program to look for a makefile in the current directory, because the error says that it couldn't find a makefile. Several of my instructions call specifically for me to include the ">"...
I searched for information on the net, but of course searching for anything to do with ">" returns literally thousands of completely unrelated material.
So, I figured I'd ask someone who knows.
Thanks for any help!
- 07-24-2008 #2
> is used to redirect output to a file (usually) what is happening with the first thing is that its just creating a file named make
the error is because there is no makefile in the directory you are trying to run make in
assuming you are following directions from somewhere, the > is not something you type it, that signifies the end of the prompt
- 07-24-2008 #3Just Joined!
- Join Date
- Jul 2008
- Posts
- 3
...told you I was a noob. Now I see the blank "make" file lmao.
The only thing is, there is a "Makefile.am" and a "Makefile.in", so I dont know why it can't find a makefile...
- 07-24-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
As coopstah13 said above, '>' is a redirection operator. It redirects the output of 'something' into 'somefile', as in:
In your case, 'something' is nothing, so, your command:Code:something > somefile
Just creates an empty file.Code:> somefile
The tool 'make' is a tool that's used to build programs from source code in an ordered manner, without having the remember the whole dependency tree of the source code.
Makefile.am and Makefile.in are files related to automake. Try to run 'automake' on that directory, and a proper 'Makefile' should be generated. Or maybe you need to run the configure script previosly.
Then you can do "make" and "make install" if you want. Without '>'Code:./configure

PS: If you intend to install it on your home, you can tipically use
Then make install will install there instead of in your system root (that would require root privileges).Code:./configure --prefix=$HOME/<whatever dir>/
- 07-25-2008 #5Just Joined!
- Join Date
- Jul 2008
- Posts
- 3
Hey guys, thanks for all the help.
The reason # make couldn't find a makefile was because when I did
# > ./configure, it created a blank file named "configure", rather than generating the appropriate Makefile....ouch


Reply With Quote