Solved

Need a quick script

Posted on 1999-01-20
4
189 Views
Last Modified: 2010-04-20
Hi. Ineed a quick BASH script which I can use to chop up a large binary file for later reasebmly on a DOS system using something like copy /b . I used to have one, but it seemed to have got lost.

Thanks in advance for your time.

Nicholas Waltham
0
Comment
Question by:nwaltham
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1639187
split -b1m file
0
 

Author Comment

by:nwaltham
ID: 1639188
:-) Well thats a nice script. Now why doesn't that command have a manual entry! Can you answer the question, and I will give you the points
0
 
LVL 84

Accepted Solution

by:
ozo earned 30 total points
ID: 1639189
split(1)                                                           split(1)

 NAME
      split - split a file into pieces

 SYNOPSIS
      split [-l line_count] [-a suffix_length] [file [name]]

      split [-b n[k|m]] [-a suffix_length] [file [name]]

      Obsolescent:
      split [-n] [file [name]]

 DESCRIPTION
      split reads file and writes it in pieces (default 1000 lines) onto a
      set of output files.  The name of the first output file is name with
      aa appended, and so on lexicographically, up to zz (only ASCII letters
      are used, a maximum of 676 files).  If no output name is given, x is
      the default.

      If no input file is given, or if - is given instead, the standard
      input file is used.

 OPTIONS
      split recognizes the following command-line options and arguments:

           -l line_count  The input file is split into pieces line_count
                          lines in size.

           -a suffix_length
                          suffix_length letters are used to form the suffix
                          of the output filenames.  This option allows
                          creation of more than 676 output files.  The
                          output file names created cannot exceed the
                          maximum file name length allowed in the directory
                          containing the files.

           -b n           The input file is split into pieces n bytes in
                          size.

           -b nk          The input file is split into pieces n x 1024 bytes
                          in size.  No space separates the n from the k.

           -b nm          The input file is split into pieces n x 1048576
                          bytes in size.  No space separates the n from the
                          m.

           -n             The input file is split into pieces n lines in
                          size.  This option is obsolescent and is
                          equivalent to using the -l line_count option.

 EXTERNAL INFLUENCES

    International Code Set Support
      Single- and multi-byte character code sets are supported with the
      exception that multi-byte-character file names are not supported.

 SEE ALSO
      bfs(1), csplit(1).

 STANDARDS CONFORMANCE
      split: SVID2, SVID3, XPG2, XPG3

0
 

Author Comment

by:nwaltham
ID: 1639190
Excellent, thank you very much
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question