Find the answer to your Linux question:
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 ...
  1. #1
    Just 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!

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    > 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

  3. #3
    Just 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...

  4. #4
    Linux 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:

    Code:
    something > somefile
    In your case, 'something' is nothing, so, your command:

    Code:
    > somefile
    Just creates an empty file.




    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.

    Code:
    ./configure
    Then you can do "make" and "make install" if you want. Without '>'

    PS: If you intend to install it on your home, you can tipically use

    Code:
    ./configure --prefix=$HOME/<whatever dir>/
    Then make install will install there instead of in your system root (that would require root privileges).

  5. #5
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...