FLIP(1)

✨ FLIP(1) ✨

okay bestie, buckle up πŸ’– this one lives in the Linux Programmer's Manual, and it's the little tool that fixes the whole CR/LF drama between **IX and MS-DOS. it's giving ✨interoperability✨ and honestly? obsessed.


🌸 NAME 🌸

flip, toms, toix β€” do newline conversions between **IX and MS-DOS πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

flip -h
flip [ -umvtsbz] file ...
flip [ -umvtsbz] -
toix [ -vtsbz] file ...
toms [ -vtsbz] file ...

πŸ’… DESCRIPTION πŸ’…

so flip is a file interchange program that converts text file formats between **ix and MS-DOS. like, it converts lines ending with carriage-return (CR) and linefeed (LF) into lines ending with just linefeed, or vice versa πŸ”. and if you hand it the special argument -, it reads input from stdin and writes to stdout. main character energy fr fr.

flip has the following features, and no we are NOT skipping any of them πŸ’œ:

  • flip will normally refuse to convert binary files. you can override this.
  • when asked to convert a file to the same format it already has, flip causes no change to the file. so to convert all files to **IX format you can type
flip -u *

and all files will end up right, regardless of whether they were in MS-DOS or in **IX format to begin with. this also works in the opposite direction 😌

  • if a file contains isolated CR characters for underlining or overprinting, flip does not change them.
  • flip preserves file timestamps. you can override this.
  • flip preserves file permissions.
  • flip is written in C and will compile and run under MS-DOS/Turbo C, 4.3BSD, and System V. vintage but make it slay πŸ’…
  • flip accepts wildcards and multiple filenames on the command line.
  • if a user interrupt aborts flip, it does not leave behind any garbage files or cause corruption of the files being converted. no mess, no crumbs 🧹
  • when converting from MS-DOS to **IX format, flip removes any trailing control Z (the last character in the file), but leaves embedded control Z characters unchanged. this minimizes the possibility of accidentally converting a binary file that contains a control Z near the beginning. you can override this and ask flip to recognize the first control Z found as end-of-file.
  • flip can be asked to strip the high (parity) bit as it converts a file.

flip is normally invoked as:

flip -umhvtb file ...

one of -u, -m, or -h is required. switches may be given separately or combined together after a dash. for example, the three command lines given below are equivalent:

flip -uvt *.c
flip -u -v -t *.c
flip -u -vt *.c

on systems that allow a program to know its own name, flip may be renamed (or linked) to a file called toix for conversion to **IX format, or to a file called toms for conversion to MS-DOS format πŸͺ„. when invoked with the name toix or toms, flip will act as if it were invoked with the -u or -m option respectively.


πŸ”₯ OPTIONS πŸ”₯

  • -u β€” convert to **IX format (CR LF => LF, lone CR or LF unchanged, trailing control Z removed, embedded control Z unchanged).
  • -m β€” convert to MS-DOS format (lone LF => CR LF, lone CR unchanged).
  • -h β€” give a help message.
  • -v β€” be verbose, print filenames as they are processed.
  • -t β€” touch files (don't preserve timestamps).
  • -s β€” strip high bit.
  • -b β€” convert binary files too (else binary files are left unchanged).
  • -z β€” truncate file at first control Z encountered.
ngl bestie, -b is the "i know what i'm doing" button. flip refuses binaries by default for a reason πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Rahul Dhesi <dhesi@bsu-cs.bsu.edu>.


🌈 SEE ALSO 🌈

unix2dos(1), dos2unix(1).


and that's the whole vibe check 🫢 this page is from Linux 2.0, dated July 20, 2002 β€” yeah she's a lil vintage, but she ate and left no crumbs. periodt πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from