Silly little regex question

From: Eric d'Alibut (eric.halibut_at_gmail.com)
Date: 02/05/05

  • Next message: matze: "Re: Disabled German guy needs Debian, free, without downloading [was: Re: Anfrage]"
    Date: Sat, 5 Feb 2005 15:30:03 -0500
    To: debian-users <debian-user@lists.debian.org>
    
    

    In a shell script:

    `eval date +%j`

    returns the so-called "Julian" date (a misnomer I believe, but there
    it is), the number of days into the present year, aka "yearday":

    $ echo `eval date +%j`
    036

    I want a regex that will strip the leading zero _or_ zeros (if it's
    January) from the yearday, using the shell contructions:

    ${string#substring} # strip shortest occurence of substring from the
    front of string
    or
    ${string##substring} # strip longest occurence of substring from the
    front of string

    where substring is a regex.

    TIA!

    -- 
    No no no, my fish's name is Eric, Eric the fish. He's an halibut. I am
    not a looney! Why should I be tarred with the epithet looney merely
    because I have a pet halibut?
    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: matze: "Re: Disabled German guy needs Debian, free, without downloading [was: Re: Anfrage]"