[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getline variables not global
From: |
Till Halbach |
Subject: |
getline variables not global |
Date: |
Wed, 14 Apr 2010 14:54:39 +0200 |
User-agent: |
Thunderbird 2.0.0.24 (X11/20100317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Summary
A global variable is not overwritten when it is set by means of getline.
OS
Description: Ubuntu 9.04
AWK
GNU Awk 3.1.6
TC1
echo -e '\n' | awk '{print "new line:"; "echo 1" | getline bar; print
bar; "echo 2" | getline bar; print bar}'
Should produce
new line:
1
2
new line:
1
2
Produces currently
new line:
1
2
new line:
2
2
TC2
echo -e '\n' | awk '{bar="should never appear"; print "new line:"; "echo
1" | getline bar; print bar; "echo 2" | getline bar; print bar}'
Should produce
new line:
1
2
new line:
1
2
Produces currently
new line:
1
2
new line:
should never appear
should never appear
Thanks,
Till
- --
http://etill.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkvFuwwACgkQxsc38LbNE947XgCfWTGCKluLIsGwxemMEdz+qFnN
mpAAoJR/hjjqD+8m+fKojKqqsPra5TWf
=BxBo
-----END PGP SIGNATURE-----
- getline variables not global,
Till Halbach <=