LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-11-2005, 12:12 PM   #1
pleowulf
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


Greetings!!

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
jtshaw
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
itsme86
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:22 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
Open Source Consulting | Domain Registration