Oh, and changing a bit of what I said in my previous post, you could instead 
just pass the strtok to strlen I think and then rewind your file pointer.  This 
should save some CPU cycles or at least save code complexity by doing it this 
way (in my mind at least).

Anyway, just a couple thoughts.

-Mike


Quoting [EMAIL PROTECTED]:

> In message <[EMAIL PROTECTED]>, Tim Kientzle writes:
> >Terry Lambert wrote:
> >
> >> Tim Kientzle wrote:
> >>>I'm trying to figure out how to read and use
> >>>/etc/rc.conf configuration variables from within
> >>>a C program. 
> >> 
> >>    #!/bin/sh
> >>    # Throw all of rc.conf into the environemnet so a C program
> >>    # named "fred" can read any of them with "getenv".
> >>    . /etc/rc.conf
> >>    fred
> 
> You can get a decent simulation this way:
> 
>       #!/bin/sh
>       echo "*** NOISE"
>       set
>       echo "*** DATA+NOISE"
>       . /etc/rc.conf
>       set
> 
> Then pipe this into your program and separate the data from the noise.
> 
> -- 
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> [EMAIL PROTECTED]         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe    
> Never attribute to malice what can adequately be explained by incompetence.
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 




-------------------------------------------------
SIUE Web Mail

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to