Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-11-2005, 12:12 PM   #1
LQ Newbie
Registered: Jun 2004
Location: León, GTO México
Distribution: Yellow Dog Linux
Posts: 3

Rep: Reputation: 0
Question HELP!! I need to program a shell


I am taking an operating systems course and my final project is to program a basic shell for any unix based system. I have no idea how to start it. I suppose I must use C but nothing else I know. I would apretiate any help or clue you could give. Honestly, thank you.
Old 02-11-2005, 12:55 PM   #2
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
The fork and the exec calls are going to be your friends here.

I did a problem like the one you describe when I was in college and I used lex and yacc to build a command parsing system. That way I was able to easily implement shell commands in a nice easy to understand manner. It also helped me implement tab completion when all was said and done, if that is something your interested in.

Since it's a school project I won't send you my source code, but if you have any specific questions about anything in particular don't hesitate to ask.
Old 02-11-2005, 01:12 PM   #3
Senior Member
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
I'm guessing the first step would be to actually print a prompt and wait for user input.


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 program in c SatYr_84 Linux - Software 1 10-03-2005 05:49 PM
can't start program from shell roxxe1 Linux - General 11 04-24-2005 07:58 PM
opening a program from shell hari78 Linux - Newbie 4 03-08-2005 09:33 AM
Shell Program Veteq Programming 12 08-18-2004 07:20 AM
bash shell program help embsupafly Programming 7 11-27-2002 12:05 AM > Forums > Non-*NIX Forums > Programming

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

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