[clug] 'dd' command detecting EOF: an example script

Steve Jenkin sjenkin at canb.auug.org.au
Wed May 15 10:00:24 UTC 2019


Peter,

not how I read the man-page, they are seriously underselling its capability.
This segmented compression is something like what I want to do.

Thanks very much!

cheers
steve

> On 15 May 2019, at 18:02, Peter Barker <pbarker at barker.dropbear.id.au> wrote:
> 
> You know, that's the way I initially read it too.  Turns out $FILE is the *output* filename!
> 
> But check out "split" here: https://www.gnu.org/software/coreutils/manual/html_node/split-invocation.html <https://www.gnu.org/software/coreutils/manual/html_node/split-invocation.html>
> 
> ================
> ‘--filter=command’
> 
>    With this option, rather than simply writing to each output file, write through a pipe to the specified shell command for each output file. command should use the $FILE environment variable, which is set to a different output file name for each invocation of the command. For example, imagine that you have a 1TiB compressed file that, if uncompressed, would be too large to reside on disk, yet you must split it into individually-compressed pieces of a more manageable size. To do that, you might run this command:
> 
>    xz -dc BIG.xz | split -b200G --filter='xz > $FILE.xz' - big-
> =================
> 
> Yours,
> -- 
> Peter Barker                          |   Programmer,Sysadmin,Geek.
> pbarker at barker.dropbear.id.au <mailto:pbarker at barker.dropbear.id.au>	      |   You need a bigger hammer.
> :: in what circumstances would you want reverse thrust for takeoff? --tridge

--
Steve Jenkin, IT Systems and Design 
0412 786 915 (+61 412 786 915)
PO Box 38, Kippax ACT 2615, AUSTRALIA

mailto:sjenkin at canb.auug.org.au http://members.tip.net.au/~sjenkin



More information about the linux mailing list