Is there a Linux command similar to yes
but one that outputs newlines? Something like
$ yes enter
That outputs
\n\n\n\n\n\n
Similar too how yes 'foo'
outputs
foo
foo
foo
Is there a Linux command similar to yes
but one that outputs newlines? Something like
$ yes enter
That outputs
\n\n\n\n\n\n
Similar too how yes 'foo'
outputs
foo
foo
foo
Similar to what was mentioned in the comments, this will do it:
yes '<enter>'
Will output the literal string <enter>
, or you can use ''
for newlines.
yes ''
~$ yes ''| cp -i a.a b.b
and it said
overwrite b.b? (y/n [n]) not overwritten
– barlop
May 24 '19 at 15:28
Well, if yes ''
wasn't good enough (and it is) but you just wanted to show off by being more esoteric you could always do
tr \\000 \\n < /dev/zero
yes enter
? – iruvar May 10 '18 at 21:43<enter>
do you mean the literal string<enter>
or the carriage return? – jesse_b May 10 '18 at 21:49yes
an empty string argument i.e.yes ''
- if you just want repeated newlines – steeldriver May 10 '18 at 22:06