Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Line

Status
Not open for further replies.

frangac

Technical User
Feb 8, 2004
163
0
0
ZA
Hi All, PHV

How can I print the getline statement from the following:

awk -v opt=Restore_Chris -v PH='/raw_data/SB/repdir/Archive_Restore/'
'BEGIN{print "connect tcenh198 dsadmin \"\""}
/MTA0000001/{print "compRead "substr($1,0,length($1)-10),"META_DOCUMENT ",PH$2}
END {print "end"
system("/sbin/rm " opt)
cmd="/ixos/sw/econ/bin/dsclient ""<"" Restore_Chris_1 "

while(((cmd) | getline CMD) >0)
{
print CMD
}
close(cmd)
}
' Restore_Chris > Restore_Chris_1

Many Thanks
Chris
 
It looks to me like you are trying to both read from Restore_Chris_1 and write to it simultaneously, which is extremely confusing and won't work.

Why don't you ned your awk script at the point where it does a print "end" and then put the subsequent commands in plain shell after it?

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top