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.
d) Also does anyone know how to empty the arrays?
PLEASE HELP..
.
- Prev by Date: Help with system calls
- Next by Date: Why googlers never quote and never will (Was: Re: Universal (g)libc)
- Previous by thread: Re: Help with system calls
- Next by thread: How to learn lists in C
- Index(es):
Relevant Pages
|