The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #8 (permalink)  
Old 10-29-2007
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Quote:
Originally Posted by vikas027 View Post
hey,
This didnt made any file, not even a blank one.
Thanks.
Sorry 'bout that - some awk's increment pre-increment ops don't seem to work the way they supposed to.

Code:
awk '/SERVER/{if (n++) close(output); output= f n} n {print >> output }' f=/vikas/list /vikas/final

On Solaris - use 'nawk' or '/usr/xpg4/bin/awk'