Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all: I have this very strange problem here. After I "make" a very simple piece of C codes, I received no errors; furthermore an executable file of that piece ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2006
    Posts
    6

    Urgent help needed


    Hi all:

    I have this very strange problem here. After I "make" a very simple piece of C codes, I received no errors; furthermore an executable file of that piece of codes was generated. But when I typed in the program's name, bash told me "program_name command could not be found." I am wondering what goes wrong to my computer / Linux. Then I tried this "hello world" programme, the same thing happned again.

    May I have some help here please.

    Thanks

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    When running the program, you will need to specify the full path to the program, not just it's name (unless it is within the $PATH variable) What you can do for this is to use:
    Code:
    ./program
    where "program" is the name of the executable and you are in the directory it is in (note: the full stop before the / this is essential).

    Otherwise you can do:
    Code:
    /home/user/program
    from anywhere where the program is again called program and is located within the /home/user directory.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    May 2006
    Posts
    6

    Thanks man it worked.

    thank you man it worked.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    That's cool... just remember ANY program not in the User's PATH variable, found by running:
    Code:
    echo $PATH
    (Note: Caps are neeeded). this will return a list of directories seperated by semi colons eg:
    Code:
    /bin;/usr/bin
    This would mean any application not in either /bin or /usr/bin would need to be run with a full path to the executable.

    Hope that helps clear things up a bit.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  6. #5
    Just Joined!
    Join Date
    May 2006
    Posts
    6

    Thank you for the further help

    Hi:

    I really appreciated your help. It is good to meet people like you to help newbie like me out.

    P.S. I briefly surfed through your website. Good effort. May I suggest you put on some pictures about your hometown or your university?

    Thanks

  7. #6
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by yuzhang
    I really appreciated your help. It is good to meet people like you to help newbie like me out.
    We were all there once, and looking for help like yourselves! Some more recent than others

    Quote Originally Posted by yuzhang
    P.S. I briefly surfed through your website. Good effort. May I suggest you put on some pictures about your hometown or your university?
    You mean the "My Boring homepage" link? Not the jedilinux one? If so, and u think it looked good, i'm guessing you didn't look at it in Internet explorer since in that it looks Awful!! But thanks for the comments... I'm just working on other sites for people at the moment, but think i will remake my site from scratch some time!
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

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