From owner-freebsd-questions@FreeBSD.ORG Mon Jul 12 14:20:52 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 53E72106564A for ; Mon, 12 Jul 2010 14:20:52 +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 E5A888FC1B for ; Mon, 12 Jul 2010 14:20:51 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkcbAG/BOkzKRa3YOWdsb2JhbAAHh2iYWgEBAQE0ASe+eoUnBIN5hw0 X-IronPort-AV: E=Sophos;i="4.55,188,1278259200"; d="scan'208";a="10867440" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.216]) by avmxsmtp2.comclark.com with ESMTP; 12 Jul 2010 22:20:50 +0800 Message-ID: <4C3B24C0.5020903@comclark.com> Date: Mon, 12 Jul 2010 22:20:48 +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:20:52 -0000 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 just 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 shouls be j