On Tue, Aug 22, 2000 at 12:49:08PM +1000, John Ferlito wrote:
> On Tue, Aug 22, 2000 at 12:36:51PM +1000, Doug Stalker wrote:
> > 
> > I'm sure this is easy but U'm having a big mental blank when I try to do
> > it.
> > 
> > I have a variable in a shell script (#!/bin/sh) which is a number
> > representing a month.  It has a 0 in the front if it is less than ten
> > (ie: July is 07) but I need to remove that leading zero.  How can I do
> > this?
> 
> newmonth = `echo $oldmonth | sed -e 's/0\([1-9]\)/\1/'`

Hmmm...

newmonth = `echo $oldmonth | sed -e 's/^0//'`

:)

Ofcourse mine presumes that that's all that is in there...

-- 
CaT ([EMAIL PROTECTED])

        'He had position, but I was determined to score.'
                -- Worf, DS9, Season 5: 'Let He Who Is Without Sin...'


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to