Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!lll-winken!llnl!ramius!rjshaw From: rjshaw@ramius.ocf.llnl.gov (Robert Shaw) Newsgroups: comp.unix.questions Subject: -F option for awk Keywords: awk field-separator Message-ID: <491@llnl.LLNL.GOV> Date: 12 Aug 90 17:12:11 GMT Sender: usenet@llnl.LLNL.GOV Reply-To: rjshaw@ramius.llnl.gov Organization: Livermore Computer Center Lines: 25 When awk'ing something like a passwd file, where the reasonable choice of field separator is something other than whitespace, how do you let a line simply fall through and be printed unchanged? print; or print $0; don't do the right thing because the lines come out with spaces as the field separators instead of the character given to the -F option. The best I can do at present is a printf. Something like printf("%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$7); to get the colon's back out when operating on a passwd-format file, for instance =============================================================================== rjshaw@ramius.llnl.gov _____ ____ ____ ______ R o b / / / / / / / / / / / -------- / --/ / / / / / / / / / --------------------------- /-- / / / / / / / / S h a w /____/ /_/_/ /_/_/ /_____/ The Cosby's are precisely what's wrong with television today... ===============================================================================