Solved

c programming in linux

Posted on 2001-08-20
3
170 Views
Last Modified: 2010-04-21
Hello,
  I am a newcomer to linux and just installed RedHat 7.0 in my PC. I wrote a very simple C program such as printing Hello World on the screen and complied the source code by typing
   gcc -o hello hello.c
The compling is Ok and a file called hello was generated.
But when i type hello to excute, it gave me such message:
bash: command hello not found.

I am really not familia with linux. Is anything wrong with the system? Or do i have to change any system file(such as .cshrc in Unix)?

Thank you.
0
Comment
Question by:huer
  • 2
3 Comments
 
LVL 3

Expert Comment

by:interiot
ID: 6407482
Try ./hello

Shells won't automatically search the local directory unless "." is part of your path, in which case you have to prepend things with "./".
0
 
LVL 3

Accepted Solution

by:
interiot earned 50 total points
ID: 6407491
You can try putting

    export PATH=.:$PATH

in your ~/.bashrc (since you appear to be running bash).
0
 

Author Comment

by:huer
ID: 6407523
Thank you very much interiot.
I wish i can get more helps from you later on.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
CentOS 6.6 Port opening question 1 135
Linux , how can I inspect a tar GZ file 3 130
install command in linux 1 43
Problem to start Neon 20 53
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now