edit first line of long file
Dan Horsfall
ddh at hare.cdc.com
Tue Oct 23 04:20:14 AEST 1990
I've seen this done somewhere, but can't for the life of me
remember what the trick was, or where I saw it...
I have a long text file. I want to pass the first line through a
short sed script, and ignore(i.e., pass unscathed) the rest of the
file.
Plan A: pass the whole file thru sed, qualifing the search string
as "1s/.../.../"; sed will look at each line of the file.
Plan B: pull off the first line with "line", pass it to sed, and
somehow magically get lines 2-n sent to stdout with cat. I'm sure
I've seen it done, with some combination of redirection, parentheses,
pipes, etc., but can't reproduce it from dim menory.
Anybody want to adopt this as their quiz-of-the-day question?
--
Horse
+ Control Data Corporation
Dan Horsfall +1-612-482-4622 + 4201 Lexington Ave North
Internet ddh at dash.udev.cdc.com + Arden Hills MN 55126 USA
More information about the Comp.unix.questions
mailing list