Welcome to the Linux Foundation Forum!

another noobee thing

The .tar files are automatically stuck in Downloads. does it matter where you are in the directory when you unpackage and ./configure them? do they load where they are suppose to go?

Comments

  • same question if you are doing a yum install?
  • marc
    marc Posts: 647
    ???
    ./
    
    This orders the shell to look into your current directory (that is "."). In fact, it adds the directory to the PATH variable. Thefore, you need to be where "configure" script is.

    And no, they don't load where they're suposed to. I will assume you are doing a classic software installation with "configure && make && make install".

    configure will ready the software to compile, make will compile it and "make install" will place the needed files in your system. NOTICE that this is standard isntallation, if your distro places things in a special way.... it probably won't work ;)

    With a "yum install" yes, everything will be in place and your system will be fine :)

    Therefore... use yum!!!

    Regards
  • chekkizhar
    chekkizhar Posts: 182
    edited January 2012
    This orders the shell to look into your current directory (that is ".")
    is it?. thanks for the info.
    But, in that way, a executable in that should work, without giving '.' , right?
    means, why we need to mention the current dir location, while we are already in the dir, where the binary file is present?

    I think all binay executables need "./" to run, unless they are in /bin or /sbin.

    Just my opinion. correct me if I am wrong Marc
    BTW, that "&&" logic you used to explain is, Good.
  • And , is the quote option working ?
  • marc
    marc Posts: 647
    Quoting still doesn't work (as neither does most of the forum functionallity).

    The shells that follow the POSIX standard look in your PATH variable for binary files to execute. In a regular *nix configuration the current working directory (shown by $PWD as in Print Working Directory) is not in the PATH variable and that's why binaries are not found when you try to execute them without the "./"

    When you type the "./" you are doing something like:
    PATH=./:$PATH
    
    Effectevely adding your current direcory to the PATH. From then on you can run binaries in your current directory :)

    If you really want to run binaries without the "./" you could add the current directory to your PATH with something like
    export PATH=$PWD:$PATH
    

    NOTICE: security risk!

    To go even deeper into this: the "." is just a file with the inode number of your current directory, i.e. the same as $PWD

    Try this:
    diff <(stat . ) <(stat $PWD)
    
    And you'll see that the only difference is the name!

    Regards
  • Thanks. Its a good information that I dont know so far.

    regarding the security risk, I will try to find what is it .

    Will get back here, if need more/clear info about that :-)

Categories

Upcoming Training