LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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-04-2013, 03:41 AM   #1
ulkoma
Member
 
Registered: Feb 2012
Distribution: CentOS
Posts: 69

Rep: Reputation: Disabled
Can we include C commands in a bash script?


Does bash understand C?

Thanks
 
Old 05-04-2013, 03:52 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Try this yourself and see.
Code:
/* Hello World program */
#!/bin/bash
#include<stdio.h>

main()
{
    printf("Hello World");


}
Have fun!
jdk
 
Old 05-04-2013, 04:19 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
C is a compiled language, Bash is an interpreted language. You would have to compile your C code first anf then run the created binary from your Bash script.
 
1 members found this post helpful.
  


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
Include file into my bash script Aerosilver Programming 2 10-28-2012 03:21 PM
SSH connection from BASH script stops further BASH script commands tardis1 Linux - Newbie 3 12-06-2010 08:56 AM
BASH commands include timestamp in filename smudge|lala Linux - General 10 03-23-2006 09:48 PM
commands behind a bash here script onurbi Linux - Software 3 11-14-2003 07:38 AM
Bash commands not include??? fxlee Linux - Newbie 4 10-26-2001 10:51 PM


All times are GMT -5. The time now is 10:19 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