From owner-freebsd-questions@FreeBSD.ORG Mon Jul 12 14:29:11 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14407106564A for ; Mon, 12 Jul 2010 14:29:11 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id A603D8FC1D for ; Mon, 12 Jul 2010 14:29:10 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkcbAMfDOkzKRa3YOWdsb2JhbAAHh2iYWgEBAQE0ASe/FoUnBIN5hw0 X-IronPort-AV: E=Sophos;i="4.55,188,1278259200"; d="scan'208";a="10873427" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.216]) by avmxsmtp3.comclark.com with ESMTP; 12 Jul 2010 22:29:09 +0800 Message-ID: <4C3B26B4.1000208@comclark.com> Date: Mon, 12 Jul 2010 22:29:08 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "questions@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: .sh check for sufix g or m on size field 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: Mon, 12 Jul 2010 14:29:11 -0000 Sorry miss send, was not done yet. Have a .sh script that accepts an -s sparse file size. Only 2 suffix's are valid m and g. Been trying to get this line of code to strip out just the single letter. But it strips the letter and every thing to the right of it. Timagesize=`echo-n "${imagesize}" | sed 's/g.*$//'` I plan to strip just the m or g if its there and the result should be numeric. If not numeric know invalid suffix. Need help with the sed syntax. Or if there is better way I want to learn it. Thanks