LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2010, 12:47 PM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Rep: Reputation: 53
Bash (Or other interpreter) CPU/system call operation


Does Bash eventually produce machine language that the CPU directly runs or does Bash some how implement system calls? What are the applications that are involved with this and what are the files. An overview of this would be helpful.



Thanks / Reputation (whatever) in advance!
 
Old 09-12-2010, 12:51 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Bash doesn't do any of that. It's an application, like any other.

It does make system calls when necessary, such as when launching programs.

Last edited by dugan; 09-12-2010 at 12:52 PM.
 
1 members found this post helpful.
Old 09-13-2010, 04:24 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by theKbStockpiler View Post
Does Bash eventually produce machine language that the CPU directly runs...
Well, eventually, yes. But there are quite a few steps between what you write and what the CPU does. At the simplest -the very, very, simplest- for an interpreted program there must be an interpreter which reads a text (or scrunched text; tokenised, or similar technology) program and converts that text into actions that are carried out.

What the CPU does -what the CPU must do- is runs instructions that it understands (actually, that's a bit of a 'cart-before-the-horse' statement; whatever series of bits/bytes/words/longwords it gets, it executes according to the instruction set; with the exception of illegal opcodes and the like, there is no question of the cpu going 'duh, I don't understand this, I'm not doing anything'; it is an instruction and the cpu follows the definition for that particular instruction it and anthropocentric concepts like 'understanding' doesn't really come into it.)

Quote:
or does Bash some how implement system calls?
Yes, it makes system calls, if that's what you mean by 'implement'. it would be difficult to write complex software without system calls or the equivalent.

Quote:
What are the applications that are involved with this and what are the files. An overview of this would be helpful.
Applications? GCC, for example? Or, for you, is an application something like 'Open Office', so a compiler can't be one?
 
1 members found this post helpful.
  


Reply



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
calling a system call inside a system call suresh.j Linux - Kernel 1 08-03-2010 09:28 PM
Bash: bad interpreter, permission denied jpantone Linux - General 22 05-27-2010 06:05 AM
[SOLVED] High CPU load on I/O operation ack_iix Slackware 8 08-08-2009 06:13 AM
interpreter directive in bash scripts jhwilliams Linux - Software 1 08-31-2007 12:09 PM
How can i make centos 4.5's system call using vDSO(call *%gs:0x10) instead of int80 tclwp Red Hat 3 08-06-2007 12:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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