LinuxQuestions.org
Latest LQ Deal: Linux Power User 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-26-2011, 03: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, 03: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, 08:48 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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, 10: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, 10:24 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
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, 11:59 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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 12:05 PM.
 
  


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

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

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