From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 16:32:09 2007 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 2E56E16A41B for ; Tue, 23 Oct 2007 16:32:09 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 0C62D13C4A7 for ; Tue, 23 Oct 2007 16:32:08 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.1/8.14.1) id l9NGVasq094379; Tue, 23 Oct 2007 11:31:36 -0500 (CDT) (envelope-from dan) Date: Tue, 23 Oct 2007 11:31:35 -0500 From: Dan Nelson To: freebsd-questions@freebsd.org, juri_mian@yahoo.com, b.movaqar@adempiere.org Message-ID: <20071023163135.GA74788@dan.emsphone.com> References: <20071023164246.13be9d63@attila> <200710231516.l9NFGSVL038402@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200710231516.l9NFGSVL038402@lurza.secnetix.de> X-OS: FreeBSD 7.0-PRERELEASE User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Subject: Re: oflag option in GNU dd - equivalent in FreeBSD dd ? 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: Tue, 23 Oct 2007 16:32:09 -0000 In the last episode (Oct 23), Oliver Fromme said: > Bahman M. wrote: > > On 2007-10-22 Juri Mianovich wrote: > > > I am used to using this command in Linux, using GNU > > > dd: > > > > > > dd if=/blah of=/bleh oflag=append conv=notrunc > > > > > > The problem is, FreeBSD 'dd' does not understand the > > > "oflag" argument. > > > > > > Is there some equivalent in the FreeBSD 'dd' syntax > > > that I can use, or am I forced to install GNU utils ? > > Of course, the easiest way is to do this: > > $ dd if=/blah >> /bleh > > If you cannot do that, please explain why. If you know > your reason, there might be an alternative way to do it. > > > dd if=/blah of=/bleh conv=notrunc seek=`ls -s /bleh | cut -f1 -d ' ' -` > > > > I don't know if any simpler way is possible (anyone?). > > $ dd if=/blah of=/bleh conv=notrunc seek=$(stat -f%z /bleh) I don't think that will work, since seek's argument is in blocks. Even if you divide by 512 (or whatever you decide to set bs=), if the file you're appending do isn't a multiple of the blocksize, you'll end up chopping part of the end off. -- Dan Nelson dnelson@allantgroup.com