Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Closed Thread
  Search this Thread
Old 08-05-2004, 03:01 PM   #1
LQ Newbie
Registered: Aug 2004
Location: Bangalore
Distribution: Redhat Linux 9.0
Posts: 25

Rep: Reputation: 15
Linux shell development

Hello everyone

could you please help me out with a project related to operating systems...
i plan to create our own shell in linux.. with a few functions
but dont know how to implement it...
could u please help!!

I know linux, and C and C++ prog
with a course in datastructures,ada
Old 08-05-2004, 03:22 PM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
All a shell does is display a prompt, wait for the user to type in a command, and performs the operation. It's just a simple user input loop. To demonstrate what I mean, here is some very simple code:

#include <stdio.h>

int main( void )
  char user_command[256];

    printf( "prompt> " );
    scanf( "%s", user_command );

    if( strcmp( user_command, "action1" ) == 0 )

    if( strcmp( user_command, "action2" ) == 0 )


  } while ( strcmp( user_command, "quit" ) != 0 )

  return 0;
That code is very primitive, but it demonstrates what I'm talking about. You would need to add some way for the shell to interpret/parse the user's command, then perform some action(s) based on it, and probably organize things a little better than a simple series of if statements.


Double-posting is against the rules. The thread in the programming forum can be found here:

Last edited by Dark_Helmet; 08-05-2004 at 03:25 PM.
Old 08-05-2004, 03:28 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.


Closed Thread

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
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Linux Development AndrewB Mandriva 4 03-21-2005 06:04 PM
Overview of Linux development? plnelson Programming 16 10-15-2004 06:57 PM
Linux shell development pony85 Programming 3 08-05-2004 10:04 PM
Linux Development p1az Linux - General 1 10-16-2003 11:29 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration