GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TUC (1)

NAME

tuc - Text to Unix Conversion (v1.10)

CONTENTS

Synopsis
Description
Usage
     Converting to UNIX
     Converting to DOS
     Examples
See Also
History

SYNOPSIS

tuc [-d|D] [-i inputfile] [-o outputfile] tuc [-d|D] [inputfile [outputfile]]

DESCRIPTION

The tuc utility converts text files from DOS, or any operating system to Unix style text files. As of version 1.10, it optionally converts files to DOS style text files.
.Lp Tuc does more than simply strip (or insert) carriage returns. It uses a state machine to check for the following line endings:

    cr/lf

    cr/lf/lf... (for multiple lines)

    cr

    lf/cr

    lf


.Lp Because of that, tuc can convert files created under any operating system to Unix text files.
.Lp The tuc utility exits 0 on success, 1 when the command line is invalid, or 2 when it cannot open a file.

USAGE

    Converting to UNIX

To convert a file to Unix text file simply enter:

    tuc inputfile outputfile


.Lp Inputfile is a text file created in any operating system. It can use any combination of carriage returns and line feeds as line terminators.
.Lp If no outputfile is specified, the output is sent to stdout. Similarly, if no inputfile is listed, tuc reads its input from stdin.
.Lp If you wish to read input from stdin but send output to a file, use the -o flag followed by outputfile. For example,

    tuc-o outputfile


.Lp You may also use the -i flag to specify inputfile explicitly. If you use both -i and -o switches, you may list the files in any order.

    Converting to DOS

Starting with version 1.10, tuc can also convert Unix files, or files created under any operating system, to DOS style text files. This requires the -d or -D switch, with a subtle difference between the two. Which switch you should use depends on the operating system.
.Lp -D will always produce DOS style output.
.Lp -d produces DOS style output if outputfile is specified. However, if output is sent to stdout, tuc will produce Unix style output. This is because tuc can be compiled as both a Unix program and a DOS program. DOS opens the console in the cooked mode. That means, DOS appends carriage returns after all line feeds sent to the console.
.Lp You only need -D under UNIX. Under DOS, choose between -d and -D, depending on where you want to send the output.

    Examples

Save the output of a Unix program to a DOS text file:

    unixprogram | tuc-D -o dostextfile


.Lp Save the output of a DOS program to a Unix text file:

    dosprogram | tuc-o unixtexfile


.Lp Filter the output of a DOS program as input to a Unix program:

    dosprogram | tuc | unixprogram


.Lp Filter the output of a Unix program as input to a DOS program:

    unixprogram | tuc -D | dosprogram

SEE ALSO

cat(1), more(1)

HISTORY

Both tuc and this manual page were written by G. Adam Stanislav <adam@whizkidtech.net>.

Search for    or go to Top of page |  Section 1 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.