Help with system calls
- From: kmrinalini@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (december_beauty)
- Date: 30 Sep 2005 16:13:37 GMT
I am writing a program which
a) accepts a command as a string
b) breaks the string into separate arguements
Eg: string : ls -l
argv[0]=ls arg[1]=-l
When I read the string using gets, it works fine. But when I use the
read(), it doesn't work.
I know how to parse the string and break them into individual
arguement, I am not happy with what I have coded it. Is there a
solution for this on the internet?
c) I need to exit when it presses ctrl-D. I don't know how to catch
ctrl-D. I tried a few things like, checking the first character of
the string with ascii value of ctrl-D, it's not working.
PLEASE HELP..
.
- Follow-Ups:
- Re: Help with system calls
- From: Eric Sosman
- Re: Help with system calls
- Prev by Date: Re: Size of structs containing unions
- Next by Date: Help with system calls
- Previous by thread: Re: printf execution problem
- Next by thread: Re: Help with system calls
- Index(es):
Relevant Pages
|