From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 16:57:10 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 D623716A421 for ; Tue, 23 Oct 2007 16:57:10 +0000 (UTC) (envelope-from b.movaqar@adempiere.org) Received: from kedah.mschosting.com (kedah.mschosting.com [202.75.42.90]) by mx1.freebsd.org (Postfix) with ESMTP id A23FD13C4B2 for ; Tue, 23 Oct 2007 16:57:10 +0000 (UTC) (envelope-from b.movaqar@adempiere.org) Received: from [87.107.63.161] (port=54940 helo=attila) by kedah.mschosting.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1IkN3l-0007ce-30; Wed, 24 Oct 2007 00:56:54 +0800 Date: Tue, 23 Oct 2007 20:26:07 +0330 From: "Bahman M." To: Dan Nelson Message-ID: <20071023202607.639f0988@attila> In-Reply-To: <20071023163135.GA74788@dan.emsphone.com> References: <20071023164246.13be9d63@attila> <200710231516.l9NFGSVL038402@lurza.secnetix.de> <20071023163135.GA74788@dan.emsphone.com> X-Mailer: Claws Mail 3.0.0 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - kedah.mschosting.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - adempiere.org X-Source: X-Source-Args: X-Source-Dir: Cc: juri_mian@yahoo.com, freebsd-questions@freebsd.org 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:57:10 -0000 On 2007-10-23 Dan Nelson wrote: > 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. > Good point! The following should cover that: sh$ dd if=/blah of=/bleh conv=notrunc bs=1 seek=$(stat -f%z /bleh) or tcsh% dd if=/blah of=/bleh conv=notrunc bs=1 seek=`stat -f%z /bleh` I wonder if bs=1 can cause any slow down when working with large files? Bahman