ubuntu-buildroot/output/build/host-gawk-5.2.0/test/getline.awk

34 lines
466 B
Awk
Raw Normal View History

2024-04-01 15:19:46 +00:00
BEGIN {
x = y = "s"
a = (getline x y)
print a, x
a = (getline x + 1)
print a, x
a = (getline x - 2)
print a, x
cmd = "echo A"
a = (cmd | getline x y)
close(cmd)
print a, x
cmd = "echo B"
a = (cmd | getline x + 1)
close(cmd)
print a, x
cmd = "echo C"
a = (cmd | getline x - 2)
close(cmd)
print a, x
cmd = "echo D"
a = cmd | getline x
close(cmd)
print a, x
# Concatenation has higher precedence than IO.
"echo " "date" | getline
print
}