This is regarding the script tunrestore in AIX 5.2
From Line 323 onwards we find the following script...
for (i=1; i<=NB_STANZAS; i++) {
xxo = STANZAS
cmd = (DSPMSG " -s " MSGSET " " MSGCAT " 20 \"Restoring %1\\$s values\n\" " xxo)
cmd | getline msg
close(cmd)
print msg >> LOGFILE
gsub(".","=",msg)
print msg >> LOGFILE
arg = ARGS[xxo]
if (arg != ""
{
system(CMDDIR "/" xxo " " arg " >> " LOGFILE " 2>&1"
}
I would like to know what does the line "cmd | getline msg" mean. I just know that something is being written to msg but what is this statement doing exactly ?
From Line 323 onwards we find the following script...
for (i=1; i<=NB_STANZAS; i++) {
xxo = STANZAS
cmd = (DSPMSG " -s " MSGSET " " MSGCAT " 20 \"Restoring %1\\$s values\n\" " xxo)
cmd | getline msg
close(cmd)
print msg >> LOGFILE
gsub(".","=",msg)
print msg >> LOGFILE
arg = ARGS[xxo]
if (arg != ""
system(CMDDIR "/" xxo " " arg " >> " LOGFILE " 2>&1"
}
I would like to know what does the line "cmd | getline msg" mean. I just know that something is being written to msg but what is this statement doing exactly ?