g | x | w | all
Bytes Lang Time Link
025Rockstar250409T160833ZShaggy
020Tcl170605T143401Zsergiol
008Perl 5 + M5.10.0 n0513240626T185408ZDom Hast
095Go240625T135946Zbigyihsu
034Hy200402T181826Zxikuuky
001W200401T093313Zuser9206
026Python 3200329T105005ZDion
002Keg200329T000826Zlyxal
045TSQL170702T023205ZWORNG AL
033LibreLogo170702T175837ZGrant Mi
001Husk170702T061125ZLeo
021Haskell170702T053730Zaimorris
017PowerShell170607T075557ZTessella
020AutoHotkey170605T093918Zphil294
006Cubix170606T204403ZMickyT
032SAS170606T192952ZJ_Lard
006Vim170606T183210ZJ_Lard
022Python 3170606T154949Zgreengla
027Perl 5170606T152351Ztale8521
006CJam170605T143001ZErik the
016><>170605T094409ZTeal pel
002Pyth170605T143450ZErik the
009Reticular170606T094103ZMayube
012OIL170606T094036ZL3viatha
008Aceto170606T093741ZL3viatha
034Java 8170606T082915ZKevin Cr
nanRuby170605T120947ZPeter Le
024C170605T222027ZClé
nanChip170605T221152ZPhlarx
007shortC170605T163710ZMD XF
005sed170605T163701ZDigital
020Groovy170605T145228ZMagic Oc
012Braingolf170605T091038ZMayube
046Go170605T141305Ztotallyh
026C170605T134934ZCody Gra
014Haskell170605T094113Znimi
020PHP170605T121153Zuser6395
002V170605T115759Znmjcman1
003Ohm170605T094131ZFrodCube
00205AB1E170605T092514ZEmigna
003Brachylog170605T115222ZLeaky Nu
004MATL170605T113533ZSuever
003QBIC170605T105345Zsteenber
040C#170605T104401ZTheLetha
024JavaScript ES6170605T103744ZTom
005Japt170605T095142ZTom
021Python 2170605T093534ZJonathan
008Bash170605T091725Zovs
027brainfuck170605T091509ZLeaky Nu
006Actually170605T091438Zuser4594
025Python 2170605T091145Zuser4594
002Jelly170605T090553ZLeaky Nu

Rockstar, 25 bytes

listen to S
while S
say S

Try it (Code will need to be pasted in)

Tcl, 20 bytes

while 1 {puts $argv}

Try it online!

Perl 5 + -M5.10.0 -n0513, 8 bytes

say;redo

Try it online!

Go, 95 bytes

package main
import(."os";."fmt")
func main(){s:=`
`
if len(Args)>1{s=Args[1]+s}
for{Print(s)}}

Attempt This Online!

An adaptation of my "yes is 91 lines long" answer. A full program, takes input from CLI args.

Hy, 34 bytes

(setv a(input))(while 1(print a))

Try it Online!

W, 1 byte

It's not an infinitely-repeating built-in. That will be explained in the explanation.

I

Explanation

With implicit inputs this becomes:

aPI

  I % An infinite loop with the following body:
a   % Take a single input from the arguments
 P  % Implicitly print the inputted argument on every iteration
    % (The above printing only occurs if the operand expression)
    % hasn't been printed before
```

Python 3, 26 bytes

a=input()
while 1:print(a)

Try it online!

As simple as it gets.

Keg, -pn, 2 bytes

{⑩

Try it online!

Forever, print the top of the stack with a newline without popping it.

T-SQL, 45 bytes

CREATE PROC r @ TEXT=NULL AS G:PRINT @ GOTO G

Usage

EXECUTE r 'Hello word!'

LibreLogo, 33 bytes

Code:

x=input " repeat [ label x bk 9 ]

Explanation:

x = input "               ; Input Stored in x as String
repeat [                  ; Endless Loop
    label x               ; Print x in Current Position
    bk 9                  ; Move Back 9 pt
]

Result:

enter image description here

Husk, 1 byte

Try it online!

In Husk, builds an infinite list repeating its argument forever. If a full program produces a list of strings as result, they get printed by joining them with newlines. The wonderful thing about Husk's laziness is that computations involving infinite lists can be managed and used to produce useful output, like in this case :)

Haskell, 21 bytes

putStr.cycle.(++"\n")

PowerShell, 17 bytes

This one taking a reasonable position towards the shorter end of the non-golf-langs:

$f={for(){$args}}

The infinite recursion approach works, at least for a while, but isn't as terse:

$f={($s="$args");& $f $s}

AutoHotkey, 20 Bytes

OP did not specify how the output should happen, said only it has to happen endlessly with a newline after it. AHK was not tailored for cmd interaction. So the output happens repeatedly in a ToolTip at mouse position:

tooltip

loop
tooltip,%1%`n`n

I like AHK's loop feature. loop repeats the next block forever, loop, 10 would repeat it 10 times. Sometimes I miss this feature in other languages like Python.

The escape character in AutoHotkey is ` (so there are no problems with backslashes in Windows paths). For some reason, a trailing newline is ignored so it is needed twice. (trayTip might not have this "bug" but I cannot test it because running with wine)

old answer:

loop
msgbox,%1%

I just realized that OP probably wont like this solution, the output happens with user-interaction and includes no newlines. I'll look for another way.

Cubix, 6 bytes

AN/qvo

Test it here

  A
N / q v
  o

I was going to remove the EOI (-1) indicator from the stack, but it doesn't appear to affect the output any, so have left it saving bytes.

SAS, 32 bytes

%macro t(s);%put&s;%t(&s);%mend;

Vim, 6 bytes

Similar solution as the V answer.

Yqqp@q

Python 3, 22 bytes

while 1:print(input())

Surprised not to have seen a python 3 answer yet.

Perl 5, 27 bytes

while(1){print"$ARGV[0]\n"}

Try it online!

CJam, 6 bytes

q{_n}h

Try it online!

><>, 16 bytes

i:0(?v
:o71.>~a{

Try it online!

As mentioned in the comments below my first attempt may have misunderstood the question so the newer 16 byte solution has been made, I have left the original below so people may see.

><>, 13 bytes

<ov!?+1:i
oa<

Try it online!

Pyth, 2 bytes

#

Unfortunately I can't remove Q :(

You need to run from command-line like this, so that this is competing:

python3 pyth.py -c "#
"

The interpreter has been fixed too.

Reticular, 9 bytes

i1=v
1`p>

Try it online!

Explanation:

i1=        Sets variable 1's value to a single line of input read from STDIN
   v       Change direction to down
   >       Change direction to right, wrap from end of line
1`p        1` fetches the value of variable 1, p prints it

OIL, 12 bytes

5

4

11
6
2

Read a value into the 0th line, print the value in the 0th line, print a newline, then jump to line 2.

Aceto, 8 bytes

>v
np
rk

Uses sticky mode to avoid having to duplicate the string.

Java 8, 34 bytes

s->{for(;;System.out.println(s));}

Surprised there wasn't a Java answer yet.

Try it here. (Wait 60 second for it to time-out.)

Ruby, 18 17 12 + 2 = 14 bytes

Run with the -n flag.

loop{$><<$_}

Edit: Thanks for @sethrin for the -n flag!

C, 24 bytes

f(char*s){puts(s),f(s);}

Basically a recursive function that outputs the string before calling herself again. Its my second post on codegolf so please be nice :p

Chip, 19+3 = 22 bytes

+3 for flag -z, which adds an infinite stream of 0x00 bytes to the end of the input.

cCGgbbBAa
fF^~^dDEe

Try it online!

The behavior, in pseudocode:

out_byte := in_byte
if !(in_byte & 0x60) {
    out_byte |= 0x0A
}

Basically, if both bits 0x20 and 0x40 are unset, then either we have a newline character, or we've hit the end of the input. In either case, we just output a newline character and carry on.

shortC, 7 bytes

AWJ@[1]

Explanation:

A        main function
 W       while loop
  J      print string with newline
   @[1]  first command line argument

Try it online!

sed, 5

:      # label (unnamed) 
p      # print the pattern space
b      # branch back to the label

Unnamed labels is an undocumented "feature" in sed that works with version 4.2.2, but may not work in future versions.

Groovy, 20 bytes

x={println it;x(it)}

Braingolf, 14 12 bytes

#
V[R!&@v1+]

Try it online!

-2 bytes thanks to totallyhuman

Explanation

#\nV[R!&@v1+]  Implicit input of string as charcodes
#\n            Push charcode of newline
   V           Create stack2
    [R...v1+]  While loop, runs endlessly
      !&@      Print entire stack1 as chars without popping

Go, 46 bytes

import."fmt"
func f(s string){for{Println(s)}}

Try it online!

Recursive approach, 46 bytes

Surprisingly, a recursive approach led to the same byte count.

import."fmt"
func f(s string){Println(s);f(s)}

Try it online!

C, 26 bytes

f(char*s){for(;;)puts(s);}

A function, f, that takes a C-style string as a parameter, s. The body of the function loops repeatedly, passing the string to the library function puts, which outputs the string to the standard output (stdout) along with a trailing new-line.

Pretty simple stuff. The only hack here is taking advantage of default-int for the return value and then not actually returning a value. That doesn't matter in this case, though, since the function never returns (it just keeps printing forever)!

Try it online!

Haskell, 14 bytes

cycle.(++"\n")

Try it online!

Append a newline to the input and make list of infinite copies of it.

Alternative version, also 14 bytes:

unlines.repeat

PHP, 20 bytes

for(;;)echo"$argn
";

V, 2 bytes

òÙ

You can't try this online for obvious reasons.

ò    'Recursively
 Ù   'Duplicate the current line downwards

Ohm, 3 bytes

∞┼,

Try it online!

It doesn't work with an empty input because Ohm is bad at input handling compared to other languages, but you can input "".

Explanation

∞     Infinite loop next code (until ";" or end of line)
 ┼    Get first input
  ,   Println

05AB1E, 2 bytes

[,

Try it online!

Brachylog, 3 bytes

ẉ?↰

Try it online!

Port of my Jelly answer.

MATL, 4 bytes

`GDT

Try it Online

Explanation

`     % Do...while loop
  G   % Grab input
  D   % Display it on a new line
  T   % Literal TRUE to create an infinite loop

QBIC, 3 bytes

{?;

Explanation

{      DO
 ?     PRINT
  ;    a string read from the cmd line
       DO is implicitly closed by EOF

C#, 40 bytes

s=>{for(;;)System.Console.WriteLine(s);}

JavaScript (ES6), 24 bytes

f=a=>f(a,console.log(a))

Try it online!

Japt, 5 bytes

OpU;ß

Try it online!

Explanation

OpU;     output the input with a newline
    ß    run the code again with the same input

Python 2, 21 bytes

def f(s):print s;f(s)

Assumes no recursion limit

Try it online!

Bash, 8 bytes

yes "$1"

Try it online!

brainfuck, 27 bytes

+[>,]++++++++++[[<]>>[.>]<]

Try it online!

Actually, 6 bytes

1W@;.@

Try it online!

Explanation:

1W@;.@  (implicit input)
1       push 1
 W      loop while top of stack is truthy:
  @       move input to top of stack
   ;.     duplicate and print
     @    move 1 to top of stack to continue loop

Python 2, 25 bytes

s=input()
while 1:print s

Try it online!

Input is expected to be a Python literal (quotes for a string, square bracket or parentheses with comma-separated items for a list/tuple, etc.)

Python 3 would be +1 byte because print is a function, but also could do raw input without the 4-byte penalty for raw_input() in Python 2.

Jelly, 2 bytes

Ṅß

Try it online!

Print with a newline, repeat the whole link (program).