.sh check for sufix g or m on size field

Aiza aiza21 at comclark.com
Mon Jul 12 14:20:52 UTC 2010


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


More information about the freebsd-questions mailing list