From owner-freebsd-questions@FreeBSD.ORG Sun Jul 3 19:21:56 2005 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 8D41116A41C for ; Sun, 3 Jul 2005 19:21:56 +0000 (GMT) (envelope-from FreeBSD@amadeus.demon.nl) Received: from post-24.mail.nl.demon.net (post-24.mail.nl.demon.net [194.159.73.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 539E943D48 for ; Sun, 3 Jul 2005 19:21:56 +0000 (GMT) (envelope-from FreeBSD@amadeus.demon.nl) Received: from amadeus.demon.nl ([82.161.18.200]:61732 helo=[10.0.1.1]) by post-24.mail.nl.demon.net with esmtp (Exim 4.43) id 1DpA2M-000Bvi-M2; Sun, 03 Jul 2005 19:21:55 +0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v730) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <63E2D68B-C621-4901-9EDE-9EBDFA45EEFD@amadeus.demon.nl> Content-Transfer-Encoding: 7bit From: FreeBSD questions mailing list Date: Sun, 3 Jul 2005 21:21:47 +0200 To: fbsd_user@a1poweruser.com X-Mailer: Apple Mail (2.730) Cc: "freebsd-questions@FreeBSD. ORG" Subject: Re: help with sh script 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: Sun, 03 Jul 2005 19:21:56 -0000 On 03 jul 2005, at 20:59, fbsd_user wrote: > > > std_text='No ALTQ support in kernel ALTQ related functions disabled' > ret_ob='No ALTQ support in kernel ALTQ related functions disabled > OK' > > ret_ob=`printf "$ret_ob" | sed 's/\$std_text//g'` > Does not strip off the std_text stuff. > > How would I code a statement to remove everything from $ret_ob > but the ok at the end so $ret_ob would only contain the ok?? > > Some times $ret_ob will end in some error message and that is > what I want to capture after striping off the std_text. > > > Thanks > hmm try this then: ret_ob=`printf "$ret_ob" | tr -d "$std_text"` Arno