2015-01-13

Scratch of the day - "yes" to all

While browsing on /usr/src/usr.bin to kill some time, found "yes". The manpage was simple:
NAME
    yes — be repetitively affirmative

SYNOPSIS
    yes [expletive]

DESCRIPTION
    yes outputs expletive, or, by default, “y”, forever.


So, it repeats "y" forever. A quick try rev up my processor to the max and raised my machine temperature to 69 Celsius in 20 seconds (usually it sits around 48).

Enough messing around. The only thing I can think now of valid use is this:

$ for i in `jot 20 1`; do touch file${i}.junk; done

$ ls
file1.junk  file11.junk file13.junk file15.junk file17.junk file19.junk file20.junk file4.junk  file6.junk  file8.junk
file10.junk file12.junk file14.junk file16.junk file18.junk file2.junk  file3.junk  file5.junk  file7.junk  file9.junk

$ yes | rm -i file1*                               
remove file1.junk? remove file10.junk? remove file11.junk? remove file12.junk? remove file13.junk? remove file14.junk? remove file15.junk? remove file16.junk? remove file17.junk? remove file18.junk? remove file19.junk?

$ ls
file2.junk  file20.junk file3.junk  file4.junk  file5.junk  file6.junk  file7.junk  file8.junk  file9.junk

A note here to remind myself, Ciao!

No comments: