From owner-freebsd-questions@FreeBSD.ORG Thu Nov 5 01:30:54 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 1F2011065670 for ; Thu, 5 Nov 2009 01:30:54 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id D449A8FC18 for ; Thu, 5 Nov 2009 01:30:53 +0000 (UTC) Received: from r55.edvax.de (port-92-195-97-236.dynamic.qsc.de [92.195.97.236]) by mx01.qsc.de (Postfix) with ESMTP id DBBAB3D832; Thu, 5 Nov 2009 02:30:51 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id nA51Uj9m002544; Thu, 5 Nov 2009 02:30:46 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Thu, 5 Nov 2009 02:30:45 +0100 From: Polytropon To: PJ Message-Id: <20091105023045.9a3d90ab.freebsd@edvax.de> In-Reply-To: <4AF1FF76.60808@videotron.ca> References: <4AF1FF76.60808@videotron.ca> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" Subject: Re: and now for conky & gremlins X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2009 01:30:54 -0000 On Wed, 04 Nov 2009 18:25:58 -0400, PJ 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, ...