Beware fmt!

The battleground for flame wars, off-topic derailments and spurious madness.
Post Reply
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Beware fmt!

Post by therube »

did you ever ...

use fmt?

Code: Select all

Usage: fmt [-DIGITS] [OPTION]... [FILE]...
Reformat each paragraph in the FILE(s), writing to standard output.
If no FILE or if FILE is `-', read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -c, --crown-margin        preserve indentation of first two lines
  -p, --prefix=STRING       reformat only lines beginning with STRING,
                              reattaching the prefix to reformatted lines
  -s, --split-only          split long lines, but do not refill
  -t, --tagged-paragraph    indentation of first line different from second
  -u, --uniform-spacing     one space between words, two after sentences
  -w, --width=WIDTH         maximum line width (default of 75 columns)
      --help     display this help and exit
      --version  output version information and exit

With no FILE, or when FILE is -, read standard input.
use fmt on a file, when wanting to affect a single line, mistakenly have it affect the entire file?

use fmt on a file, when wanting to affect a single line, mistakenly have it affect the entire file, & not realize it until after the fact, until you had closed & saved the changes?

did you have vim set to not make backups?

did said file happen to be on a networked computer's 'Desktop'?

and did you always use simple batch files to do your backups, compressed with ARJ, & specifically included said file, because it would be nice to have backups of it - in case.

and then did you pickup a simple "backup" utility, backup9, that you ran periodically just to back up a few select files, yet again, including that said file?

and then did you start thinking, oh, why deal with batch files, when i can use this fancy, free file sync, that you back up all kinds of stuff, in a bit more automated fashion.

and so you do backup all kinds of stuff.

but that all kinds of stuff didn't happen to include said file, because it happened to be on a particular computer's 'Desktop', which is a kind of out of the way place for something to be.

and then did you kind of let the batch file backups slide, oh, just haven't run them in a while.

likewise, with that simple backup program, back9. you know, too difficult to every so often, click a button on your desktop, knowing that one day it might just save your ass.

and then one day you come along, & paste some text copied from a website into said file & it pastes as one long line. so you say, oh, well, i'll just fmt it.

and then you type in !]]fmt & format that line & you smile, because now its broken into a dozen shorter lines, more easily readable.

and then you open said file again to look something up, & you say, what? what's going on here?

and then it dawns on you that you meant to type in !!fmt, to affect that single line, but instead you typed in !]]fmt affecting the entire file.

and then you say, crap.

and then you say, oh, but i have backups.

and then you think about it for a minute, & you say...

but i've kind of let my batch file backups slide.
but i've kind of let my backup9 backups slide too.
and then you realize that your free file sync backups were not actually backing up said file.

then you say, oh crap!

not because its such a horrendous loss, not because all the data isn't there - it is, just rearranged, a bit, not because you don't have any backups, you do have some, but more because, you just screwed up!

man, i need a beer.

:-)


Vim
fmt (coreutils)
ARJ
BACKUP9
FreeFileSync
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:43.0) Gecko/20100101 SeaMonkey/2.40
Post Reply