LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-26-2011, 02:24 AM   #1
vikas_choudharyy
LQ Newbie
 
Registered: May 2011
Posts: 7

Rep: Reputation: Disabled
Question shell programming


how to write own shell in linux?
i want to know procedure of shell programming.
 
Old 05-26-2011, 02:59 AM   #2
Hevithan
Member
 
Registered: Apr 2011
Location: Washington State
Distribution: Zorin5-(Ubuntu 11.04) // Backtrack 5-(Ubuntu 10.04) // Dreamlinux 3.5-(Debian)
Posts: 275
Blog Entries: 5

Rep: Reputation: 40
http://www.linuxcommand.org/

http://voxel.dl.sourceforge.net/proj...TLCL-09.12.pdf <<<same as above link, but direct to the book.

I am currently reading this "book" (it is a PDF file), it was the response to a question I asked earlier. It explains all the basic commands, the WHY of your shells working and how to write your own scripts, as well as tons of other stuff. I am finding it to be well written and easy to understand. Hope thats the kinda thing you where looking for. Good luck!
 
1 members found this post helpful.
Old 05-26-2011, 07:48 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by vikas_choudharyy View Post
how to write own shell in linux?
i want to know procedure of shell programming.
Shell scripting and writing a shell are completely different things.

Which one are you talking about?
 
Old 05-26-2011, 09:03 AM   #4
vikas_choudharyy
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
thanks Hevithan...

MTK358: i got an assignment from my teacher to write my own shell which should work similar to bash shell of linux. it should
perform the tasks feed as commands, if command is not valid, it should show invalid command.
 
Old 05-26-2011, 09:24 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by vikas_choudharyy View Post
thanks Hevithan...

MTK358: i got an assignment from my teacher to write my own shell which should work similar to bash shell of linux. it should
perform the tasks feed as commands, if command is not valid, it should show invalid command.
You mean it has to validate if the commands exist and, if they do, it has to use bash to run them? Presumably it is not required to check the syntax of the commands ... ? Does it have to service bash builtins and aliases or only externals? Did your teacher say which language you can do this in?
 
Old 05-26-2011, 10:59 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by catkin View Post
You mean it has to validate if the commands exist and, if they do, it has to use bash to run them?
Read the OP's post more carefully:

Quote:
Originally Posted by vikas_choudharyy
write my own shell which should work similar to bash shell
For a really simple shell you could for every line just separate the command by spaces and pass them to the command as arguments. But a full-featured shell like bash is pretty much a primitive programming language interpreter.

http://www.google.com/search?q=how+t...UTF-8&oe=UTF-8

http://www.google.com/search?q=how+t...UTF-8&oe=UTF-8

http://en.wikipedia.org/wiki/Parser

Last edited by MTK358; 05-26-2011 at 11:05 AM.
 
  


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
Shell Programming Moody1 Linux - Newbie 5 10-15-2009 06:54 PM
shell programming wolfipa Programming 4 11-14-2007 05:49 AM

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

All times are GMT -5. The time now is 05:14 AM.

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