From owner-freebsd-questions@FreeBSD.ORG Wed Jan 18 10:02:01 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82A9916A4A0 for ; Wed, 18 Jan 2006 10:02:00 +0000 (GMT) (envelope-from spap@avrolymos.com) Received: from rly-ip08.mx.aol.com (rly-ip08.mx.aol.com [64.12.138.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 112D443D46 for ; Wed, 18 Jan 2006 10:01:59 +0000 (GMT) (envelope-from spap@avrolymos.com) Received: from smtp-los04.proxy.aol.com (smtp-los04.proxy.aol.com [195.93.24.101]) by rly-ip08.mx.aol.com (8.12.11/8.12.11) with ESMTP id k0ODQ5pL024516; Tue, 24 Jan 2006 08:26:15 -0500 Received: from koukou (ACC8C8CA.ipt.aol.com [172.200.200.202]) by smtp-los04.proxy.aol.com (8.12.11/8.12.11) with ESMTP id k0IA1qUH030662; Wed, 18 Jan 2006 05:01:52 -0500 Message-Id: <200601181001.k0IA1qUH030662@smtp-los04.proxy.aol.com> From: "Spiros Papadopoulos" To: "'Alexander Pohoyda'" Date: Wed, 18 Jan 2006 09:58:08 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <200601180945.k0I9jZQt000486@oak.pohoyda.family> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 thread-index: AcYcFCFJBJpygyhlSna1mIJeVle/nwAAA+EA X-Scanned-By: MIMEDefang 2.43 Cc: freebsd-questions@freebsd.org Subject: RE: String variable expansion routine wanted 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: Wed, 18 Jan 2006 10:02:01 -0000 Hi, Well If I understood well you need printf() Definitely check the manual page: #man 3 printf You can use printf() like this: vartype Variable = declaration; /* string or int or double etc */ /* will print your text and the variable in the middle */ printf("some text... %type_of_variable ... more text", variable); You can use multiple variables like that if you want of any type: int = 1; string = "Hello"; .... .... ..... printf("(text)number: %i(int), text: %s, text: %..., text: %... , text: ...", int, string, ..., ..., ...); Spiros P. > -----Original Message----- > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd- > questions@freebsd.org] On Behalf Of Alexander Pohoyda > Sent: Wednesday, January 18, 2006 9:46 AM > To: freebsd-questions@freebsd.org > Subject: String variable expansion routine wanted > > Hi folks, > > Is there a C-function that does string variable expansion like this: > > "some text $(VARIABLE) text" --> "some text VALUE text" > > I suppose this functionality is useful for many programs, so I'm > looking for a simpe library to link with. > > Please CC me on reply. Thanks a lot! > > -- > Alexander Pohoyda > PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org"