nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 23-06-2006, 11:53 AM
Junior Member
User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #2 (permalink)  
Old 23-06-2006, 12:01 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 23-06-2006, 12:08 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
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


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 Off


Similar Threads

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


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


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38