Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.programmer Subject: Re: how to truncate lines Message-ID: <1991Feb19.023029.13065@convex.com> Date: 19 Feb 91 02:30:29 GMT References: <1991Feb18.205238.14418@dartvax.dartmouth.edu> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 15 Nntp-Posting-Host: pixel.convex.com From the keyboard of mdm@icefloe.dartmouth.edu (Michael McDaniel): :I am trying to write a simple shell script that will truncate lines fed :from the standard input to 80 characters. I only want the first 80 :characters, and I know that there is some way to get awk to do it, but I :can't remember how to do it. #!/bin/awk -f print substr($0,1,80) Somebody should buy that guy a manual for Christmas. --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "All things are possible, but not all expedient." (in life, UNIX, and perl)