Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 22:20:48 +0800
From:      Aiza <aiza21@comclark.com>
To:        "questions@freebsd.org" <questions@freebsd.org>
Subject:   .sh  check for sufix g or m on size field
Message-ID:  <4C3B24C0.5020903@comclark.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C3B24C0.5020903>