Silly little regex question
From: Eric d'Alibut (eric.halibut_at_gmail.com)
Date: 02/05/05
- Previous message: Roberto Sanchez: "Re: Compile programs on sarge (glibc 2.3.2) to run on woody (glibc 2.2.5)?"
- Next in thread: Dan Roozemond: "RE: Silly little regex question"
- Reply: Dan Roozemond: "RE: Silly little regex question"
- Reply: gcrimp_at_vcn.bc.ca: "Re: Silly little regex question"
- Reply: Justin Pryzby: "Re: Silly little regex question"
- Reply: Adam Aube: "Re: Silly little regex question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Roberto Sanchez: "Re: Compile programs on sarge (glibc 2.3.2) to run on woody (glibc 2.2.5)?"
- Next in thread: Dan Roozemond: "RE: Silly little regex question"
- Reply: Dan Roozemond: "RE: Silly little regex question"
- Reply: gcrimp_at_vcn.bc.ca: "Re: Silly little regex question"
- Reply: Justin Pryzby: "Re: Silly little regex question"
- Reply: Adam Aube: "Re: Silly little regex question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|