RosettaCodeData/Task/Copy-a-string/AWK/copy-a-string.awk

7 lines
113 B
Awk

BEGIN {
a = "a string"
b = a
sub(/a/, "X", a) # modify a
print b # b is a copy, not a reference to...
}