how to truncate lines
Tom Christiansen
tchrist at convex.COM
Tue Feb 19 13:30:29 AEST 1991
>From the keyboard of mdm at 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 at convex.com convex!tchrist
"All things are possible, but not all expedient." (in life, UNIX, and perl)
More information about the Comp.unix.programmer
mailing list