Date: Thu, 05 Nov 2009 10:41:23 -0400 From: PJ <af.gourmet@videotron.ca> To: Ruben de Groot <mail25@bzerk.org>, PJ <af.gourmet@videotron.ca>, Polytropon <freebsd@edvax.de>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: and now for conky & gremlins Message-ID: <4AF2E413.2080907@videotron.ca> In-Reply-To: <20091105144609.GA28950@ei.bzerk.org> References: <4AF1FF76.60808@videotron.ca> <20091105023045.9a3d90ab.freebsd@edvax.de> <4AF2D277.3090406@videotron.ca> <20091105144609.GA28950@ei.bzerk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Ruben de Groot wrote: > On Thu, Nov 05, 2009 at 09:26:15AM -0400, PJ typed: > >> Polytropon wrote: >> >>> On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@videotron.ca> wrote: >>> >>> >>>> output should be: 1 2 3 [4] 5 6 7 etc. >>>> is: 1 2 3 4 5 6.... >>>> >>>> the calendar.sh is exactly: >>>> #!/bin/sh >>>> cal | awk 'NR>1' | sed -e 's/ / /g' -e 's/[^ ] /& /g' -e 's/..*/ >>>> &/' -e "s/\ `date +%d`/\[`date +%d`\]/" >>>> >>>> >>> It's quite obviously. Let's try the last substitution >>> argument in plain shell: >>> >>> % date +%d >>> 05 >>> >>> But the command creates this: >>> >>> Su Mo Tu We Th Fr Sa >>> 1 2 3 4 5 6 7 >>> >>> The leading zero is missing, so there's no substition that >>> changes "5" into "[5]", because the search pattern is "05". >>> >>> >> Ok, I see... I'm not too good in programming. I guess I didn't notice >> the previous to the first days of November the date was always 2 >> digits.. how do I get rid of the zero? Regex substitution or something >> like that? >> > > date "+%e" should do it. > Sure did.... For the moment, I changed the [ ] to just plain > maybe that will avoid the disjointed row. But changing the color of the current date sure would be nice... but is there a way to do that?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AF2E413.2080907>