Date: Sat, 10 Oct 2009 15:27:16 +0200 From: Roland Smith <rsmith@xs4all.nl> To: PJ <af.gourmet@videotron.ca> Cc: freebsd-questions@freebsd.org Subject: Re: conky calendar Message-ID: <20091010132716.GA33706@slackbox.xs4all.nl> In-Reply-To: <4AD04D6E.5000309@videotron.ca> References: <4AD04D6E.5000309@videotron.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
--u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > #!/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 --=20 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) --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkrQi7MACgkQEnfvsMMhpyVlLgCgn5V4nfFcWZH3kLOe2CtD09uB Gt8AoIC5wQw+sQ721feJ9K8cAIRQmqi+ =w7I/ -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091010132716.GA33706>