FizzBuzz: Difference between revisions

m
→‎GNU sed: Tweaking the last one a bit
(→‎{{header|Sed}}: Clarification re one-liner and two other one-liners)
m (→‎GNU sed: Tweaking the last one a bit)
Line 5,920:
Using the option ''-z (--zero-data)'' first introduced in GNU sed 4.2.2 (2012-12-22):
<lang sed>
sed -nz '3~3s/^/Fizz/;5~5s/$/Buzz/;tx;=;b;:x;p;100q' /dev/zero | sed 'sy/\c@/\n/g'
</lang>
Second invocation of ''sed'' translates null characters to newlines. The same could be achieved with <tt>tr \\0 \\n</tt>
7

edits