From owner-freebsd-questions@FreeBSD.ORG Mon Aug 25 09:39:39 2008 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 961B9106566C for ; Mon, 25 Aug 2008 09:39:39 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57002.mail.re3.yahoo.com (web57002.mail.re3.yahoo.com [66.196.97.106]) by mx1.freebsd.org (Postfix) with SMTP id 388A58FC1A for ; Mon, 25 Aug 2008 09:39:39 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 17718 invoked by uid 60001); 25 Aug 2008 09:39:38 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=jkTn9qqQXmyqxLCDdBOstJjIb1tGOog+4+gua5ehSZV1uLM2gn3E/duf5gnDa/Z9tZRm5gRdbUxtWUvcHFYExJLq0T6QdhysWE8Mh2PF9PfZ9FwHZyZrFtIu4D4kht6jjCr6VRjZztox59Qz3EEIYHG45o3FZrYFSWE8tfyvquM=; X-YMail-OSG: KpN1f24VM1lwxxX.sY2.AgEyfjN3SN2JwX2lMmRlPRHx.DH13q0HbxH2NI2lwKqF1xeXYXLBrvDg_sV_xO6H3zX18bQRJG.tMRN5FeX_hPHURLfIdPADFc2Uby22ifTw9sc- Received: from [165.21.154.108] by web57002.mail.re3.yahoo.com via HTTP; Mon, 25 Aug 2008 02:39:38 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Mon, 25 Aug 2008 02:39:38 -0700 (PDT) From: Unga To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <499449.17617.qm@web57002.mail.re3.yahoo.com> Subject: string split, bash and IFS X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: unga888@yahoo.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2008 09:39:39 -0000 Hi all How to use bash and IFS to split a string? eg. $string = "Name:Surname:10" IFS=: echo "$string" | read name surname age This does not work for some reason. The read does not create name, surname and age variables. Any idea why? Appreciate your reply. Kind regards Unga