theoxo / 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 39.7%Language:PHP 18.5%Language:Assembly 5.6%Language:C 2.6%Language:Visual Basic 2.1%Language:Objective-C 1.9%Language:F# 1.9%Language:Fortran 1.7%Language:TypeScript 1.6%Language:C++ 1.5%Language:JavaScript 1.1%Language:Ada 1.1%Language:Clojure 1.0%Language:R 0.9%Language:Vala 0.9%Language:Rust 0.9%Language:Java 0.9%Language:Prolog 0.9%Language:Dart 0.8%Language:Scheme 0.7%Language:AppleScript 0.7%Language:Nim 0.7%Language:Lua 0.7%Language:D 0.7%Language:OCaml 0.7%Language:Scala 0.7%Language:C# 0.7%Language:Kotlin 0.6%Language:Awk 0.6%Language:Groovy 0.6%Language:Swift 0.6%Language:Haskell 0.6%Language:Go 0.6%Language:Common Lisp 0.6%Language:Brainfuck 0.6%Language:Python 0.5%Language:Pascal 0.5%Language:Erlang 0.5%Language:Ruby 0.5%Language:Perl 0.5%Language:PowerShell 0.4%Language:Crystal 0.4%Language:Batchfile 0.3%Language:Elixir 0.3%Language:CoffeeScript 0.2%