[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Fwd: Re: Shell-Creation. A simulation Code



These are errors I got When I compiled your programm..
test.c: In function `main':
test.c:6: `str' undeclared (first use in this function)
test.c:6: (Each undeclared identifier is reported only once
test.c:6: for each function it appears in.)
test.c:10: parse error before `1'
test.c:3: warning: return type of `main' is not `int'

regards
alex
On Tue, 22 Aug 2000, Archan Paul wrote:

> Hi Madhu,
> Please see the attached code of a very basic simulated shell which i had
> written two yrs ago... It is just a basic code to make u understand.
> I have mined this code from my old data CD and it is working at least. Still I
> am in search of the code which is a complete shell (clone of csh) and written
> by me in the early last year. As soon as I get it, I will give u the code.
> 
> Please compile the file using 
> 	$gcc sunix.c
> under bash ... Linux 
> 
> Please don't use Wall to compile as it will give u hell warning .... Currently
> I don't have time to remove those :>)
> 
> Thanx
> Archan Paul
> Lateral Linux Labs
> archanp@xxxxxxxxxxx
> 
> PS. Thaths, Please allow this mail to be posted in the list along with
> attachment. :)
> 
> 
> On Tue, 22 Aug 2000, you wrote:
> > hi madhu
> > 	i've a very simple, crude, barebones program that does a sort of
> > create a shell. i remember i used it to escape the command logging by bash
> > and also the display of commands by w.it's old and uses gets() which u r
> > not supposed to.
> > --------start of program------
> > #include<stdio.h>
> > void main()
> > {
> > 	do {
> > 		printf("command:>");
> > 		gets(str);
> > 		if (strcmp(str,"exit")==0)
> > 			exit(0);
> > 		system(str);
> > 	  } while 1;
> > }
> > --------end------------
> > 	me thinks it works( it worked long ago) , but i dont know if it
> > has mistakes. *BUT YOU CANNOT USE ANY INTERNAL COMMANDS !!!!!! *. means
> > cd also wont work ! hope this gives u the idea ;-)
> > 
> > cheers
> > cheedu
> > 
> >  On Mon, 14 Aug 2000, Madhu Sudhan.S wrote:
> > 
> > > Hello Everybody,
> > > 
> > > Can any one on the list please educate me on how to Create a private
> > > Unix Shell of my own, allowing only a few basic simple commands on that
> > > to work on that, like the ls, cd, etc.,. Other commands, like su, etc.,
> > > should
> > > throw an error "Command not found".
> > > 
> > > Anticipating quick reply ......
> > > 
> > > Regards
> > > Madhu Sudhan.S
> > > 
> > > 
> > 
> 
> 
> 
> -------------------------------------------------------
> 
> 
>