conky calendar

Roland Smith rsmith at xs4all.nl
Sat Oct 10 13:27:18 UTC 2009


On Sat, Oct 10, 2009 at 05:01:34AM -0400, PJ wrote:
> I'm having a bit of a time with the calendar.sh script I found on the
> Net; it doesn't display quite correctly.
> It should have brackets around the current date, but I can't figure out
> what is not functioning correctly:
> 
> #!/bin/sh
> cal | awk 'NR>2' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/  &
> /' -e 's/ \('`date | awk '{print $2}'`'\) /\['`date | awk '{print $2}'`'\]/'

Look at the output of the date command:
Sat Oct 10 15:12:39 CEST 2009

Change 'print $2' to 'print $3' to get the numercal date.
Or even simpler: use "date +%d" instead of "date | awk '{print $3}'".

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091010/ae4302c6/attachment.pgp


More information about the freebsd-questions mailing list