ccp 1.2

ccp can copy stdin or file to stdout, file to file, or files to directory, including recursive copying of directories.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
GPL (GNU General Public License) 
2.8/5 16
A. G. Grozin
ROOT \ Utilities
ccp is a software that can copy stdin or file to stdout, file to file, or files to directory, including recursive copying of directories. While copying, it can apply one or several recordings. A recoding maps each byte to one or several (e.g., zero) bytes. Recoding tables are read from files. A recoding table can be in the text form or in the binary form. You can easily write a recoding table as a text file. Binary files are usually smaller and can be loaded faster. They can be produced from text recoding files by ccp. The project can also multiply recordings - produce a table which has the same effect as several recordings applied sequentially. This multiplication is, of course, not commutative.

The base distribution contains recoding tables for converting DOS text files to Unix text files and back (d2u and u2d), conversions between Russian encoding koi8-r, alt (cp866), win (cp1251), iso-8859-5, LaTeX (T2A) in any direction (k2a, i2k, a2w, k2l, etc.), for converting these encoding to transliteration (recordings k2t, etc.), and for filtering out control characters (recoding c).

Some typical examples of use:

ccp -d2u /dos/mydir/*.txt somedir/
converts DOS text files to UNIX text files
ccp -d2u -a2k /dos/mydir/rus.txt rus.txt
converts DOS russian text in alt to UNIX russian text in koi8
ccp -u2d -k2w rus.txt /dos/mydir/rus.txt
converts UNIX russian text in koi8 to Windows russian text
ccp -d2u -a2k =da2uk
produces the table for recoding DOS alt -> UNIX koi8
ccp -da2uk /dos/mydir/rus.txt | more
copies rus.txt to stdout using this table
ccp -x2y file1 dir2 file3 dir
copies file1, dir2 (recursively), and file3 into dir
ccp -x2y dir/ newname
creates the directory newname, and copies all files in dir into it (recursively)
ccp +a2k =k2a
inverts a2k producing k2a
ccp -l2k -k2w =
dumps the product of the recordings l2k and k2a into stdout, in the text form
foo | ccp -i2k | bar
copies stdin to stdout (use in pipes)
ccp -x2y - | telnet must.die | ccp -y2x -
telnet to a host using a different encoding
ccp -c strange_file | more
view file filtering out control characters

You can easily write your own recoding tables. Here is an example:

# This is a comment
'a' -> 'b'
0F -> 0A # hexadecimal
'x' -> 'uvw'
'y' ->
# y is recoded to nothing
1A -> 2A2B2C # hexadecimal
"z" -> "abc" # "z" and 'z' are equivalent
"'" -> '"' # ' is recoded to "

If you call this file code.16 you can use
ccp -code foo bar

You can also compile the text file code.16 into a binary form code :
ccp -code =code

Several options may be combined:
ccp -code1 -code2 =code12 +code3 foo bar

means take recoding code1, multiply it by code2, store the result in code12, then multiply by the recoding inverse to code3 and copy foo to bar using the resulting recoding.

You can specify a list of directories where to search for recoding tables via the environment variable CCPPATH. They are separated by :. By default, /usr/share/ccp:. is used. In each directory, ccp first tries to find the binary form; if not successful, then the text form with the extension .16

Last updated on January 25th, 2008

#multiply recordings #recoding maps #text recoding #multiply #recordings #text #map

Add your review!