Hello experts.
I have a problem with getting input from getline into
the main portion of this script..
slist | awk ' {
$0 = $1
split($0,server,"\n"
print server[1]
print "SAVE(y|n): "
getline choice < "-"
if (choice == "yes"
{
print server[1] >> "/tmp/foo"
}'
(for testing only-the original was
awk '
function get_in(arr, temp,choice,num) {
temp = "/tmp/foo"
getline choice < "-"
if (choice != "no"
{
print arr[num] >> temp
}
}
{
main
}
I would rather do this with awk, than have to write it in
expect or the shell since the data is being generated
this way easily.
Thanks.
I have a problem with getting input from getline into
the main portion of this script..
slist | awk ' {
$0 = $1
split($0,server,"\n"
print server[1]
print "SAVE(y|n): "
getline choice < "-"
if (choice == "yes"
print server[1] >> "/tmp/foo"
}'
(for testing only-the original was
awk '
function get_in(arr, temp,choice,num) {
temp = "/tmp/foo"
getline choice < "-"
if (choice != "no"
print arr[num] >> temp
}
}
{
main
}
I would rather do this with awk, than have to write it in
expect or the shell since the data is being generated
this way easily.
Thanks.