From owner-freebsd-stable@freebsd.org Thu Jun 8 09:15:20 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69EADBFA503 for ; Thu, 8 Jun 2017 09:15:20 +0000 (UTC) (envelope-from christopherhall.hsw@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 337A97A8DC for ; Thu, 8 Jun 2017 09:15:20 +0000 (UTC) (envelope-from christopherhall.hsw@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id v18so3994675pgb.3 for ; Thu, 08 Jun 2017 02:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uRcNxoUB/jtkxcyj8K4LbVVwgenKDpMK33p1+KisFYY=; b=FCF0rtYwYMGlSYY14M4U2Fw0HuHU+vKDNODvH4MEKkGx8NkYo5oRBHbCIwGTKLpJe0 MIA1qfIdwiyWjxduaotaMesLL+skCXyJ0TIn99Uq7ioFjWb6esIp/p9fQTWEglvGGoK0 y/WwzVHcwt8naK4IU6/UPdD8jaJHoPvkXVDKbgoTkU/5JwyJLgrRGRIXf3+SdOQ1YgRX 7IHXhKGjejFcdsqm/cYfWGUXjLK/FpxAQ+cEzwitNiJ0e0MRPdKdTzBYtQTimlMfLgeq GghNLveyiNpSxKy7Xt/oWKR8wlVku2m42bRl0tn/KROybk9jVouwVWOjddtE9FKy8tql mYEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uRcNxoUB/jtkxcyj8K4LbVVwgenKDpMK33p1+KisFYY=; b=PinyYSYPUNhnDXDB/vSndqAa63o5OJWKx6MyvlA9ua4Yc58M+m79HVdmJOk3b33OXT d7vi2RVxqOBJ0v+VS7nTqDL5Qo1bwUrNPDgXXD/X+xk1MLp33Rr5NhQ+UsplPTffgK7B 6tJ8R3iZyU1LeY6IRtamIcIXq4bilFFTSUnNP05d3Dt49mVRTwb6wwV2HXTsubEV3yPY TC9j09zRwqyAq0hsft2GCKhuHnNsDD7gP8uWfyPN5ebD6QB+JN/SJJMVQMEunQXGTyl9 K6vdqbB/qT7TH9jo0N9tJ22dNwB2PWlwBdw/wGsIoSmYHhnQ58LYzRqlGFO6e6WyCmI8 TItw== X-Gm-Message-State: AODbwcDQNqZE348Aa2UFs+wOb4aHDJVDMTPTXpK8DO25/bB8jolcONBs GXW4CMBddiXR8w== X-Received: by 10.84.232.8 with SMTP id h8mr33072108plk.278.1496913319668; Thu, 08 Jun 2017 02:15:19 -0700 (PDT) Received: from arria.bitmark.lan ([2001:b030:2314:200:2de0:ec0:2e3:41ee]) by smtp.gmail.com with ESMTPSA id g23sm3784141pfj.131.2017.06.08.02.15.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2017 02:15:19 -0700 (PDT) Date: Thu, 8 Jun 2017 17:15:15 +0800 From: Christopher Hall To: Dewayne Geraghty Cc: freebsd-stable stable Subject: Re: dd is returning different content using same inputs Message-ID: <20170608171515.72fa7844@arria.bitmark.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 09:15:20 -0000 Hello Dewayne, On Thu, 8 Jun 2017 18:10:11 +1000, Dewayne Geraghty wrote: > I'm attempting to skip the first three bytes of a file and then pull > the header out of message. Please note the file size varies between > 105 and 54 bytes, even though the input file and everything else > remains constant, on > > FreeBSD hathor 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE #0 r319562M: > Mon Jun 5 03:13:08 AEST 2017 > root@hathor:/110007/D/K8/hqdev-amd64-smp-vga amd64 1100514 1100514 > > # rm encheader;dd if=/tmp/tLbdoJ/encmessage bs=1 skip=3 | dd bs=384 > count=1 of=encheader ; ls -lrth encheader > 0+1 records in > 0+1 records out > 105 bytes transferred in 0.000026 secs (4071661 bytes/sec) > -rw-r--r-- 1 root wheel 105B Jun 8 16:35 encheader > # rm encheader;dd if=/tmp/tLbdoJ/encmessage bs=1 skip=3 | dd bs=384 > count=1 of=encheader ; ls -lrth encheader > 0+1 records in > 0+1 records out > 67 bytes transferred in 0.000026 secs (2554912 bytes/sec) > -rw-r--r-- 1 root wheel 67B Jun 8 16:35 encheader > # rm encheader;dd if=/tmp/tLbdoJ/encmessage bs=1 skip=3 | dd bs=384 > count=1 of=encheader ; ls -lrth encheader > 0+1 records in > 0+1 records out > 68 bytes transferred in 0.000024 secs (2867263 bytes/sec) > -rw-r--r-- 1 root wheel 68B Jun 8 16:35 encheader > # rm encheader;dd if=/tmp/tLbdoJ/encmessage bs=1 skip=3 | dd bs=384 > count=1 of=encheader ; ls -lrth encheader > 0+1 records in > 0+1 records out > 54 bytes transferred in 0.000025 secs (2167717 bytes/sec) > -rw-r--r-- 1 root wheel 54B Jun 8 16:35 encheader > # rm encheader;dd if=/tmp/tLbdoJ/encmessage bs=1 skip=3 | dd bs=384 > count=1 of=encheader ; ls -lrth encheader > 0+1 records in > 0+1 records out > 91 bytes transferred in 0.000024 secs (3751494 bytes/sec) > -rw-r--r-- 1 root wheel 91B Jun 8 16:35 encheader > > I used this around May 8th (from a OS and ports rebuild on 4th May) > and was performing some final testing on an 11.1 Prerelease built on > Jun 5. > It works similarly on TrueOS (FreeBSD 12) I suspect it is because you block sizes are different on the input and output dd commands. I would think that the output block size (obs) on 1st dd needs to be specified the same input block size on receiving dd to make it work correctly. > This works correctly so perhaps I'm not using dd correctly? > dd if=/tmp/tLbdoJ/encmessage skip=1 bs=3 | dd bs=1 count=384 > of=encheader ; hd encheader|head -n1; ls -l encheader > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to > "freebsd-stable-unsubscribe@freebsd.org" -- Best Regards. Christopher Hall.