Krazune / yes

yes - Implementation of simple and dangerous yes command in various languages. :+1:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yes

About yes

The yes command is used to output y, or whatever word you choose, forever. πŸ”

yes

Description

The yes command outputs the same string, STRING, in a constant stream. If STRING is not specified, the word it repeats is y. πŸ”

yes dates back to a time before Unix commands included the "force" (-f) option, which for many commands is the same as answering "yes" to all prompts.

yes can be used to do something very similar: if the output of yes is piped to a command, it will effectively answer "yes" to any confirmation prompts.

yes Syntax

yes [STRING]...

yes Output

y
y
y
y
y
y
.
.
.

Dangerous yes

Redirecting output to a file

yes can be dangerous also. If you redirect the output stream of yes to a file, it will eat up your storage space. πŸ’£

$ yes >> yes.txt
^Z

$ du -h yes.txt
1007M yes.txt

I ran the command only for 10 Seconds. And It consumed almost 1 GB. πŸ’₯

Nested yes

yes takes an argument and prints it infinitely. What if you take yes as argument itself. πŸ’£

$ yes `yes`

You tell me what happens. 😜

About

yes - Implementation of simple and dangerous yes command in various languages. :+1:

License:MIT License


Languages

Language:Shell 41.7%Language:PHP 20.2%Language:C 2.8%Language:Visual Basic 2.2%Language:Objective-C 2.1%Language:F# 2.1%Language:TypeScript 1.7%Language:C++ 1.6%Language:JavaScript 1.2%Language:Pure Data 1.2%Language:Ada 1.2%Language:Assembly 1.1%Language:Clojure 1.0%Language:R 1.0%Language:Vala 1.0%Language:Rust 1.0%Language:Java 1.0%Language:Prolog 0.9%Language:Dart 0.8%Language:AppleScript 0.8%Language:Lua 0.8%Language:D 0.8%Language:OCaml 0.7%Language:Scala 0.7%Language:C# 0.7%Language:Kotlin 0.7%Language:Awk 0.7%Language:Groovy 0.7%Language:Swift 0.7%Language:Python 0.7%Language:Haskell 0.6%Language:Go 0.6%Language:Common Lisp 0.6%Language:Brainfuck 0.6%Language:Pascal 0.6%Language:Erlang 0.5%Language:Ruby 0.5%Language:Perl 0.5%Language:PowerShell 0.5%Language:Crystal 0.4%Language:Batchfile 0.4%Language:CoffeeScript 0.2%