From owner-freebsd-audit Thu Oct 4 23:38:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id F220C37B409 for ; Thu, 4 Oct 2001 23:38:46 -0700 (PDT) Received: from blossom.cjclark.org (dialup-209.245.134.128.Dial1.SanJose1.Level3.net [209.245.134.128]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id XAA24892; Thu, 4 Oct 2001 23:38:44 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id f956YxS03055; Thu, 4 Oct 2001 23:34:59 -0700 (PDT) (envelope-from cjc) Date: Thu, 4 Oct 2001 23:34:59 -0700 From: "Crist J. Clark" To: Dag-Erling Smorgrav Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dmesg.boot Gets Overwritten without Reboot Message-ID: <20011004233459.M297@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <20011003221310.Q8391@blossom.cjclark.org> <20011004152541.I297@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Fri, Oct 05, 2001 at 01:00:31AM +0200 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Oct 05, 2001 at 01:00:31AM +0200, Dag-Erling Smorgrav wrote: > Dag-Erling Smorgrav writes: > > $ find /var/run -type f -name dmesg.boot -newermt "$(sysctl -n kern.boottime | sed 's/.*}//')" > > /var/run/dmesg.boot > > Sorry, I forgot you don't have sed(1) available. Use this: Actually, we do. If we're playing in /var... > boottime="$(sysctl -n kern.boottime)" > foo="$(find /var/run -type f -name dmesg.boot -newermt "${boottime#*\}}")" > if [ "${foo}" != "/var/run/dmesg.boot] ; then > echo 'Spank me!' > fi But more intereting, does this tickle a sh(1) bug? I've reproduced this on several FreeBSD machines (-STABLE and -CURRENT), #!/bin/sh boottime="$(sysctl -n kern.boottime)" echo "Without quotes: " ${boottime#*\}} echo "With quotes: " "${boottime#*\}}" Produces, Without quotes: Thu Oct 4 11:44:35 2001 With quotes: { sec = 1002221075, usec = 383948 } Thu Oct 4 11:44:35 2001 I'm not sure what is going on in the second one. I've tried to do some metacharacter escapes, but no luck. bash produces, Without quotes: Thu Oct 4 11:44:35 2001 With quotes: Thu Oct 4 11:44:35 2001 Which is more like what I expect. -- Crist J. Clark cjclark@alum.mit.edu cjclark@jhu.edu cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message