Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2009 02:30:45 +0100
From:      Polytropon <freebsd@edvax.de>
To:        PJ <af.gourmet@videotron.ca>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: and now for conky & gremlins
Message-ID:  <20091105023045.9a3d90ab.freebsd@edvax.de>
In-Reply-To: <4AF1FF76.60808@videotron.ca>
References:  <4AF1FF76.60808@videotron.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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".



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091105023045.9a3d90ab.freebsd>