#! /usr/bin/awk -f BEGIN { fizz = "Fizz"; buzz = "Buzz"; fizzbuzz = "FizzBuzz" for (i = 1; i <= 30; i++) { f = i % 3 == 0 b = i % 5 == 0 print f ? b ? fizzbuzz : fizz : b ? buzz : i } }