From owner-freebsd-questions@FreeBSD.ORG Tue May 11 17:57:30 2010 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 CB04D106566B for ; Tue, 11 May 2010 17:57:30 +0000 (UTC) (envelope-from vogelke@hcst.com) Received: from beta.hcst.com (beta.hcst.com [192.52.183.241]) by mx1.freebsd.org (Postfix) with ESMTP id 923B28FC13 for ; Tue, 11 May 2010 17:57:30 +0000 (UTC) Received: from beta.hcst.com (localhost [127.0.0.1]) by beta.hcst.com (8.13.8/8.13.8/Debian-3) with ESMTP id o4BHvT9I005856; Tue, 11 May 2010 13:57:29 -0400 Received: (from vogelke@localhost) by beta.hcst.com (8.13.8/8.13.8/Submit) id o4BHvTFC005855; Tue, 11 May 2010 13:57:29 -0400 Received: by bsd118.wpafb.af.mil (Postfix, from userid 583) id 4B861BE5F; Tue, 11 May 2010 13:56:21 -0400 (EDT) To: David Allen In-reply-to: (message from David Allen on Mon, 10 May 2010 17:35:45 -0800) Organization: Array Infotech X-Disclaimer: I don't speak for the USAF or Array Infotech. X-GPG-ID: 1024D/711752A0 2006-06-27 Karl Vogel X-GPG-Fingerprint: 56EB 6DBF 4224 C953 F417 CC99 4C7C 7D46 7117 52A0 References: Message-Id: <20100511175621.4B861BE5F@bsd118.wpafb.af.mil> Date: Tue, 11 May 2010 13:56:21 -0400 (EDT) From: vogelke@bsd118.wpafb.af.mil (Karl Vogel) Cc: freebsd-questions@freebsd.org Subject: Re: md5(1) and cal(1) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vogelke+unix@pobox.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2010 17:57:30 -0000 >> On Mon, 10 May 2010 17:35:45 -0800, >> David Allen said: D> 1. Why doesn't cal(1) hilight the current day? I'm not sure, but it's easy enough to script. See below the signature. If you don't have /bin/ksh, change the first line to #!/bin/sh. You definitely need either the Linux compatibility stuff or a decent version of ncurses installed for this to work. The basic version of tput (/usr/bin/tput) will not do the trick. D> 2. Why doesn't md5(1) have a "check" option? Seems to me requiring a D> manual inspection is error-prone at best, and makes scripting D> unecessarily complicated. Agreed. That's why I always install the GNU coreutils package, which includes the "md5sum" program. -- Karl Vogel I don't speak for the USAF or my company If men ruled the world #14: The 'Cops' program would be broadcast live so that you could phone in advice to the cops -- or crooks. --------------------------------------------------------------------------- #!/bin/ksh # # $Revision: 1.8 $ $Date: 2010-04-20 14:14:45-04 $ # $UUID: b604e100-38b2-33b6-8816-ab401a8fb12d $ # # NAME: # month # # DESCRIPTION: # Runs "cal" to get the current month, and uses the # terminal standout codes to highlight today's date. # # AUTHOR: # Found this in a Unix mag # # NOTES: # Include /usr/compat/linux/usr/bin in PATH on FreeBSD unless you've # installed a recent version of ncurses. PATH=/usr/local/bin:/bin:/usr/bin export PATH DAY=$(date +%d | sed 's/0\([123456789]\)/ \1/') SMSO=$(tput smso) RMSO=$(tput rmso) cal | sed -e 's/^/ /' -e "3,\$s/ ${DAY}/ ${SMSO}${DAY}${RMSO}/" exit 0