{
    "content": [
        {
            "type": "text",
            "text": "# fromdos(1) (man)\n\n**Summary:** tofrodos - Converts text files between DOS and Unix formats.\n\n**Synopsis:** fromdos [ options ] [file...]\ntodos [ options ] [file...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | — | — | fault, Tofrodos does the expected thing for text files. That is, when converting from DOS to Unix, it will remove carria |\n| -b | — | — | the original filename, silently replacing any existing file of that name. For exam‐ ple, a file called \"filename.ext\" be |\n| -d | — | — | direction. By default, if the program is named fromdos or dos2unix, it will assume that the input file is in a DOS forma |\n| -e | — | — | process the next file on the command line when it encounters any errors. This option causes it to abort on errors. |\n| -f | — | — | gram finds that the file does not have write permission, it will not process that file. This option forces the conversio |\n| -h | — | — |  |\n| -l | — | — | Log error messages to <logfile>. Note that if your command line has an error, such as when you specify an unknown option |\n| -o | — | — |  |\n| -p | — | — | DOS, it only preserves the file time. Note that on many Unix-type systems, including Linux, the file ownership will only |\n| -u | — | — |  |\n| -v | — | — |  |\n| -V | — | — |  |\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (9 lines)\n- **OPTIONS** (1 lines) — 12 subsections\n  - -a (9 lines)\n  - -b (8 lines)\n  - -d (8 lines)\n  - -e (3 lines)\n  - -f (3 lines)\n  - -h (1 lines)\n  - -l (4 lines)\n  - -o (1 lines)\n  - -p (6 lines)\n  - -u (1 lines)\n  - -v (1 lines)\n  - -V (1 lines)\n- **EXIT CODE** (8 lines)\n- **AUTHOR** (10 lines)\n\n## Full Content\n\n### NAME\n\ntofrodos - Converts text files between DOS and Unix formats.\n\n### SYNOPSIS\n\nfromdos [ options ] [file...]\ntodos [ options ] [file...]\n\n### DESCRIPTION\n\nDOS  text files traditionally have carriage return and line feed pairs as their newline char‐\nacters while Unix text files have the line feed as their newline character.  fromdos converts\nASCII  and  Unicode UTF-8 text files from the DOS format to the Unix format, while todos con‐\nverts them from the Unix format to the DOS format.\n\nThe programs accept multiple filenames and wildcards as their arguments.  You  may  also  use\nthem  in  a  pipe.   If  either program finds its input redirected, it will process stdin and\nplace the output on stdout.\n\n### OPTIONS\n\n#### -a\n\nfault,  Tofrodos does the expected thing for text files. That is, when converting from\nDOS to Unix, it will remove carriage returns only if they are followed by line  feeds.\nWhen  converting  from Unix to DOS, it will add carriage returns only if the linefeeds\nare not already preceeded by carriage returns. When Tofrodos is run on a  normal  text\nfile  that  has  already been converted, the resulting file should be identical to the\noriginal. However, if you use this option, the program will always remove carriage re‐\nturns  in the DOS to Unix mode and always add carriage returns in the Unix to DOS mode\neven if it is not appropriate.\n\n#### -b\n\nthe  original  filename, silently replacing any existing file of that name.  For exam‐\nple, a file called \"filename.ext\" becomes \"filename.ext.bak\"  replacing  any  existing\nfile  having  the name \"filename.ext.bak\".  Important: the program behaves differently\nif it is compiled for DOS (as compared to being compiled for Windows, Linux, Mac OS  X\nor  other  systems). In view of the filename restrictions present on DOS, the DOS exe‐\ncutable will strip the original file extension, if any, from the file before appending\nthe .bak extension. For example, \"filename.ext\" becomes \"filename.bak\".\n\n#### -d\n\ndirection. By default, if the program is named fromdos or  dos2unix,  it  will  assume\nthat the input file is in a DOS format and convert it to a Unix format. If the program\nis named todos or unix2dos, it will assume that the input file is in a Unix format and\nconvert  it  to a DOS format. Using the -d option forces the program to convert from a\nDOS format to a Unix format regardless of how the program is  named.  Likewise,  using\nthe -u option forces the program to convert from a Unix format to a DOS format regard‐\nless of the name of the program.\n\n#### -e\n\nprocess  the  next file on the command line when it encounters any errors. This option\ncauses it to abort on errors.\n\n#### -f\n\ngram  finds  that  the  file  does not have write permission, it will not process that\nfile. This option forces the conversion even if the file is read-only.\n\n#### -h\n\n#### -l\n\nLog error messages to <logfile>. Note that if your command line has an error, such  as\nwhen  you specify an unknown option, the error message for the command line option er‐\nror will be issued to stderr instead and not logged.\n\n#### -o\n\n#### -p\n\nDOS,  it  only preserves the file time. Note that on many Unix-type systems, including\nLinux, the file ownership will only be preserved if the program is run as root, other‐\nwise it will just set the file time and silently fail the change of file ownership. On\nsuch systems, if you want a warning message when the file ownership cannot be changed,\nuse -v (the verbose flag) as well.\n\n#### -u\n\n#### -v\n\n#### -V\n\n### EXIT CODE\n\nTofrodos terminates with an exit code of 0 on success and 1 on error.\n\nIf  the  program is invoked with multiple files on the command line, the default behaviour is\nto skip to the next file in the list if an error is encountered with  any  file.  In  such  a\ncase,  the exit code returned will the status of the last file processed (ie, 0 on success, 1\non failure). If this is not desirable, use the -e option, which will  force  the  program  to\nabort immediately with the appropriate exit code on encountering any error.\n\n### AUTHOR\n\nThe  program  and  its  documentation  are copyrighted (c) 1996-2013 by Christopher Heng. All\nrights reserved. They are distributed under the terms of the GNU General Public License  Ver‐\nsion 2.\n\nThe latest version of tofrodos can be obtained from\nhttp://www.thefreecountry.com/tofrodos/index.shtml\n\n\n\n2013                                       Version 1.7.13                                tofrodos(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "fromdos",
        "section": "1",
        "mode": "man",
        "summary": "tofrodos - Converts text files between DOS and Unix formats.",
        "synopsis": "fromdos [ options ] [file...]\ntodos [ options ] [file...]",
        "flags": [
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": "fault, Tofrodos does the expected thing for text files. That is, when converting from DOS to Unix, it will remove carriage returns only if they are followed by line feeds. When converting from Unix to DOS, it will add carriage returns only if the linefeeds are not already preceeded by carriage returns. When Tofrodos is run on a normal text file that has already been converted, the resulting file should be identical to the original. However, if you use this option, the program will always remove carriage re‐ turns in the DOS to Unix mode and always add carriage returns in the Unix to DOS mode even if it is not appropriate."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "the original filename, silently replacing any existing file of that name. For exam‐ ple, a file called \"filename.ext\" becomes \"filename.ext.bak\" replacing any existing file having the name \"filename.ext.bak\". Important: the program behaves differently if it is compiled for DOS (as compared to being compiled for Windows, Linux, Mac OS X or other systems). In view of the filename restrictions present on DOS, the DOS exe‐ cutable will strip the original file extension, if any, from the file before appending the .bak extension. For example, \"filename.ext\" becomes \"filename.bak\"."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "direction. By default, if the program is named fromdos or dos2unix, it will assume that the input file is in a DOS format and convert it to a Unix format. If the program is named todos or unix2dos, it will assume that the input file is in a Unix format and convert it to a DOS format. Using the -d option forces the program to convert from a DOS format to a Unix format regardless of how the program is named. Likewise, using the -u option forces the program to convert from a Unix format to a DOS format regard‐ less of the name of the program."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "process the next file on the command line when it encounters any errors. This option causes it to abort on errors."
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "gram finds that the file does not have write permission, it will not process that file. This option forces the conversion even if the file is read-only."
            },
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-l",
                "long": null,
                "arg": null,
                "description": "Log error messages to <logfile>. Note that if your command line has an error, such as when you specify an unknown option, the error message for the command line option er‐ ror will be issued to stderr instead and not logged."
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "DOS, it only preserves the file time. Note that on many Unix-type systems, including Linux, the file ownership will only be preserved if the program is run as root, other‐ wise it will just set the file time and silently fail the change of file ownership. On such systems, if you want a warning message when the file ownership cannot be changed, use -v (the verbose flag) as well."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a",
                        "lines": 9,
                        "flag": "-a"
                    },
                    {
                        "name": "-b",
                        "lines": 8,
                        "flag": "-b"
                    },
                    {
                        "name": "-d",
                        "lines": 8,
                        "flag": "-d"
                    },
                    {
                        "name": "-e",
                        "lines": 3,
                        "flag": "-e"
                    },
                    {
                        "name": "-f",
                        "lines": 3,
                        "flag": "-f"
                    },
                    {
                        "name": "-h",
                        "lines": 1,
                        "flag": "-h"
                    },
                    {
                        "name": "-l",
                        "lines": 4,
                        "flag": "-l"
                    },
                    {
                        "name": "-o",
                        "lines": 1,
                        "flag": "-o"
                    },
                    {
                        "name": "-p",
                        "lines": 6,
                        "flag": "-p"
                    },
                    {
                        "name": "-u",
                        "lines": 1,
                        "flag": "-u"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    }
                ]
            },
            {
                "name": "EXIT CODE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 10,
                "subsections": []
            }
        ]
    }
}