From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 15:18:44 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 89DCB16A419 for ; Tue, 23 Oct 2007 15:18:44 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 01F8513C4A8 for ; Tue, 23 Oct 2007 15:18:43 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id l9NFGShe038403; Tue, 23 Oct 2007 17:16:35 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l9NFGSVL038402; Tue, 23 Oct 2007 17:16:28 +0200 (CEST) (envelope-from olli) Date: Tue, 23 Oct 2007 17:16:28 +0200 (CEST) Message-Id: <200710231516.l9NFGSVL038402@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, juri_mian@yahoo.com, b.movaqar@adempiere.org In-Reply-To: <20071023164246.13be9d63@attila> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 23 Oct 2007 17:16:38 +0200 (CEST) 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 Reply-To: freebsd-questions@FreeBSD.ORG, juri_mian@yahoo.com, b.movaqar@adempiere.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2007 15:18:44 -0000 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 suggest to write a small alias or shell function if you need to use such commands often. The following shell function (for sh, zsh or bash) will do: ddappend() { dd if="$1" of="$2" conv=notrunc seek=$(stat -f%z -- "$2") } Then you can simply write: $ ddappend /blah /bleh Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd Passwords are like underwear. You don't share them, you don't hang them on your monitor or under your keyboard, you don't email them, or put them on a web site, and you must change them very often.