Subject: bug#18827: [Feature request] no CR for yes

From: Pádraig Brady <[email-masked]>
Date: Fri, 21 Nov 2014 12:20:42 +0000

tag 18827 wontfix
close 18827
stop

On 25/10/14 18:59, Pádraig Brady wrote:
> On 10/25/2014 03:53 PM, George Shuklin wrote:
>> Yes is very nice to generate large repeating patterns, but it always adds
>> \n at the end. It's OK for the string data but sometimes mess with binary.
>>
>> Any way to disable it will be really appreciated. F.e. -n key (like for
>> 'echo'), or any other.
> 
> Does this suffice?
> 
>   yes whatever | tr -d '\n'

Closing this now since existing tools can do it quite efficiently.
Some more examples:

text lines clocking patterns: (pass to tr -d '\n' to remove new lines)

  101010...   yes 1$'\n'0
  111111...   yes 1
  111000...   yes 1$'\n'0 | sed 'p;p'
  123456...   seq inf

binary pattern generation:

  010101...   tr '\0' 'U' < /dev/zero

cheers,
Pádraig.