From owner-freebsd-questions@FreeBSD.ORG Thu Jul 21 13:28:54 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98F3106564A for ; Thu, 21 Jul 2011 13:28:54 +0000 (UTC) (envelope-from DStaal@usa.net) Received: from mail.magehandbook.com (173-8-4-45-WashingtonDC.hfc.comcastbusiness.net [173.8.4.45]) by mx1.freebsd.org (Postfix) with ESMTP id AFFB28FC14 for ; Thu, 21 Jul 2011 13:28:54 +0000 (UTC) Received: from www.magehandbook.com (www.darkmindweb.net [192.168.1.100]) by mail.magehandbook.com (Postfix) with ESMTP id 7A950BC6 for ; Thu, 21 Jul 2011 09:28:53 -0400 (EDT) Received: from 152.121.16.254 (SquirrelMail authenticated user daniel) by www.magehandbook.com with HTTP; Thu, 21 Jul 2011 09:28:53 -0400 Message-ID: In-Reply-To: References: Date: Thu, 21 Jul 2011 09:28:53 -0400 From: "Daniel Staal" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: Question about regular expressions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 13:28:54 -0000 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. ---------------------------------------------------------------