Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Easy shell scripting question


Malcolm Tredinnick <malcolm@xxxxxxxxxxxxxxxxx> wrote:

>
> I'm not sure how important portability is here, but if you are on a
> linux system then /bin/sh is linked to /bin/bash. In bash you can do
> this as:

In fact this is required by SuS so it is portable.

> 	oldmonth=3D'07'
> 	echo ${oldmonth#'0'}
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt