From owner-freebsd-questions@FreeBSD.ORG Sat Oct 10 13:27:18 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6D8106568B for ; Sat, 10 Oct 2009 13:27:18 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr10.xs4all.nl (smtp-vbr10.xs4all.nl [194.109.24.30]) by mx1.freebsd.org (Postfix) with ESMTP id DABDA8FC1A for ; Sat, 10 Oct 2009 13:27:17 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id n9ADRGHX041085; Sat, 10 Oct 2009 15:27:16 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 1CF52BAAD; Sat, 10 Oct 2009 15:27:16 +0200 (CEST) Date: Sat, 10 Oct 2009 15:27:16 +0200 From: Roland Smith To: PJ Message-ID: <20091010132716.GA33706@slackbox.xs4all.nl> References: <4AD04D6E.5000309@videotron.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <4AD04D6E.5000309@videotron.ca> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: conky calendar X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 13:27:18 -0000 --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--