[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Silly little regex question



On Sat, 5 Feb 2005 22:40:48 +0100, Dan Roozemond <dan+debian@banaan.org> wrote:

> or inside a shell script you might use:
> T=`date +%j | sed 's/^0\+\(.*\)/\1/'`

Ok; I may use that.
 
> If you insist on using this shell construction, it will look like:
> T=`date +%j`
> U=${T##"0"}
> echo $U

I get different results:

bash-2.05b$ yearday="002" ; echo ${yearday##"0"}
02
 
> > where substring is a regex.

> This sentence makes me think I misunderstood your question.

I don't think you've misunderstood. The sentence is from here:

http://www.tldp.org/LDP/abs/html/string-manipulation.html


Best,

-- 
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?



Reply to: