xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/nasty2.awk (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1*e6d6c189SCody Peter Mello# Based on nasty.awk, test same thing for printf
2*e6d6c189SCody Peter Mello#
3*e6d6c189SCody Peter MelloBEGIN {
4*e6d6c189SCody Peter Melloa="aaaaa"
5*e6d6c189SCody Peter Melloa=a a #10
6*e6d6c189SCody Peter Melloa=a a #20
7*e6d6c189SCody Peter Melloa=a a #40
8*e6d6c189SCody Peter Melloa=a a #80
9*e6d6c189SCody Peter Melloa=a a #160
10*e6d6c189SCody Peter Melloa=a a # i.e. a is long enough
11*e6d6c189SCody Peter Mello
12*e6d6c189SCody Peter Melloprintf("a = %s, f() = %s\n", a, f())
13*e6d6c189SCody Peter Melloprint a
14*e6d6c189SCody Peter Mello}
15*e6d6c189SCody Peter Mello
16*e6d6c189SCody Peter Mellofunction f()
17*e6d6c189SCody Peter Mello{
18*e6d6c189SCody Peter Mellogsub(/a/, "123", a)
19*e6d6c189SCody Peter Melloreturn "X"
20*e6d6c189SCody Peter Mello}
21