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