LinuxQuestions.org
Visit Jeremy's Blog.
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 11-06-2003, 05:22 PM   #1
homerz
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
Stripped down shell.


Can someone give me the c code for a stripped down shell that has the following form:

while (TRUE) { /* repeat forever */

type_prompt( ); /* display prompt */

read_command (command, parameters) /* input from terminal */



if (fork() != 0) { /* fork off child process */

/* Parent code */

waitpid( -1, &status, 0); /* wait for child to exit */

} else {

/* Child code */

execve (command, parameters, 0); /* execute command */

}

}

Thanks.
 
Old 11-06-2003, 05:33 PM   #2
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
find the source code for BASH and go from there
 
Old 11-07-2003, 09:09 AM   #3
cludwin
Member
 
Registered: Feb 2002
Distribution: Slack
Posts: 50

Rep: Reputation: 16
I wrote one for class last year,
just type:

$ tar zxfv smsh.tar.gz

to extract it and type:

$ make

to build it.

hope this helps,
cludwin

be sure to let me know when you have got it so I can take the link down I don't like the idea of leaving old hw solutiions on the web because it screws over people taking the class and the professors.


Last edited by cludwin; 11-09-2003 at 11:00 AM.
 
Old 11-07-2003, 01:02 PM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
i got one on my site as well, www.1nfamus.netfirms.com
 
  


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
Need Stripped Down Kernel JohnFM3 Linux - General 6 06-02-2005 10:47 PM
stripped/non-stripped binaries spuzzzzzzz Linux - General 4 02-13-2004 06:11 AM
stripped down Linux? JustinBrown Linux - Software 12 07-25-2003 12:02 AM
Stripped||not stripped Cyth Linux - General 4 11-20-2001 01:47 PM
Stripped Firewall fenris@bu Linux - Security 1 07-10-2001 08:35 PM

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

All times are GMT -5. The time now is 07:20 AM.

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