Date: Tue, 23 Oct 2007 17:16:28 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-questions@FreeBSD.ORG, juri_mian@yahoo.com, b.movaqar@adempiere.org Subject: Re: oflag option in GNU dd - equivalent in FreeBSD dd ? Message-ID: <200710231516.l9NFGSVL038402@lurza.secnetix.de> In-Reply-To: <20071023164246.13be9d63@attila>
next in thread | previous in thread | raw e-mail | index | archive | help
Bahman M. <b.movaqar@adempiere.org> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710231516.l9NFGSVL038402>