nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to creat a Shell in C lang

This is a discussion on How to creat a Shell in C lang within the Shell scripting forums, part of the Development/Scripting category; If anyone know, how to creat a SHELL in c languge, Please contact me through my email. (shauom@yahoo.com ). If ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-23-2006, 12:53 PM
Junior Member
 
Join Date: Jun 2006
Posts: 1
Rep Power: 0
shanuka
Send a message via ICQ to shanuka
Default How to creat a Shell in C lang

If anyone know, how to creat a SHELL in c languge, Please contact me through my email. (shauom@yahoo.com ). If you have any code, Please send to my mail ID.

shanuka
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-23-2006, 01:01 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Creating a shell is not big deal. You can download existing source code of BASH or other shell from internet and study it. Here are download links:

Tutorial:
Writing Your Own Shell by Hiran Ramankutty =>
http://linuxgazette.net/111/ramankutty.html (Includes C source code)

Other downloads
BASH => http://www.gnu.org/software/bash/
KSH => http://www.research.att.com/~gsf/download/

BTW, please don’t post your email ID. It is not against forum rules but spam bots would use your email id.

If you need further help, feel free to post in our forum
Reply With Quote
  #3 (permalink)  
Old 06-23-2006, 01:08 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 4
tom is on a distinguished road
Default

shanuka, you can download source code:

Code:
wget http://linuxgazette.net/111/misc/ramankutty/listing9.c.txt
mv listing9.c.txt myshell.c
To compile above code type command:
Code:
gcc myshell.c -o myshell
To run the shell:
Code:
./myshell
You should see prompt as follows:
[MY_SHELL ]

Type the commands:
Code:
/bin/ls
/bin/date
Press CTRL+D to exit

Hope this helps
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
how to creat new batch cheecoo Linux software 1 11-20-2007 09:39 PM
writing a shell script to find out my shell name jaymob123 Shell scripting 1 10-08-2007 01:36 AM


All times are GMT +5.5. The time now is 08:06 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36