LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2016, 11:57 AM   #1
krapykreme
LQ Newbie
 
Registered: Feb 2016
Posts: 8

Rep: Reputation: Disabled
How to run a C program on terminal


Hi guys,

So for my assignment, I have to write a shell in C and include functions such as cd,pwd and exit, among others. my question now is how do I run my program? I did gcc -std=c99 myShell.C, (-std=c99 flag, because it did not agree to initialize a variable in a for loop) and it compiles with warnings. So now, I would like to test and see if my functions work, but I have no idea how to do that. Thanks in advance.
 
Old 02-11-2016, 12:08 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,259

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Since you didn't provide an output filename with the -o flag, it compiled your code into the default executable name "a.out". If you run "ls", you should see it sitting there in the same directory where you ran your gcc command. You can execute it with "./a.out".
 
1 members found this post helpful.
Old 02-11-2016, 12:12 PM   #3
krapykreme
LQ Newbie
 
Registered: Feb 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
works like a charm! thanks a billion bud!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] use a C program to run a command on terminal one girl Programming 5 04-19-2014 11:49 AM
[SOLVED] Program won't run without terminal liquid paper Linux - Software 13 11-06-2013 07:17 PM
how do you run a program from terminal? fatbeaver Linux - Newbie 1 04-26-2006 01:41 PM
any way to continue using the terminal while any program is being run? g_srinivas Linux - Newbie 6 07-20-2005 09:30 AM
How to run a program on another terminal SharpyWarpy Linux - General 2 02-10-2005 03:09 PM


All times are GMT -5. The time now is 06:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration