Question about regular expressions

Daniel Staal DStaal at usa.net
Thu Jul 21 13:28:54 UTC 2011


On Wed, July 20, 2011 10:33 pm, dave jones wrote:
> Hi,
>
> I have a config file below:
>
> $user        =   'root';           // This is the username
>
> if $user is found, I want to display root.
> Anyone knows how to programming in C or some other language? thank you.

I'm not quite sure what you are asking here.  Found where?  Display where?
 Are we just reading through the config file?  Are we processing some
other file with it's config?

It should be simple in Perl or some similar scripting language, if I knew
what you meant.  (Except for the comment, that could be a Perl file.  If
so, one way to 'process' the config file would be to execute it in your
main program, and then just use the variables assigned in it as regular
variables.)

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------



More information about the freebsd-questions mailing list