LinuxQuestions.org
Help answer threads with 0 replies.
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 05-18-2008, 11:36 PM   #1
jkeertir
Member
 
Registered: Mar 2008
Posts: 75

Rep: Reputation: 15
running a C program from shell script


Dear ALl,

I am unable to run a C program from a shell script.I have compiled a C program using gcc.I want to run this C program from a shell script .Is it possible to run a C program from shell script.

Please can anyone help me to solve this issue.

With Regards,
Keerti
 
Old 05-19-2008, 12:00 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,388

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
Well, please show us what you've tried, but basically its:

#!/bin/bash
/path/to/cprog
 
Old 05-19-2008, 12:41 AM   #3
jkeertir
Member
 
Registered: Mar 2008
Posts: 75

Original Poster
Rep: Reputation: 15
Dear chrism01

Thanks .it is working.I was trying it as
./path/of/cprog/
and
`. /path/of/cprog/`

With regards
keerti
 
Old 05-19-2008, 05:05 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
The dot '.' stands for the current directory.
 
  


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
Shell script to start another program, if not running. cooljai Linux - Software 13 03-13-2012 04:39 AM
Problem running C++ program in Linux Shell Alkibiades Programming 17 10-28-2006 06:51 AM
Running shell script within a C or C++ program Quantum0726 Programming 2 06-15-2005 09:14 PM
running a program from shell script Suinatsa Programming 10 04-14-2005 11:25 AM
How to determine whether a PROCESS is running, by a SHELL program? yuzuohong Linux - General 4 01-21-2003 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration