Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!uc!shamash!hare!ddh From: ddh@hare.cdc.com (Dan Horsfall) Newsgroups: comp.unix.questions Subject: edit first line of long file Message-ID: <27338@shamash.cdc.com> Date: 22 Oct 90 18:20:14 GMT Sender: news@shamash.cdc.com Reply-To: ddh@dash@udev.cdc.com (Dan Horsfall) Organization: Control Data Corp, Arden Hills, MN Lines: 22 Distribution: 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@dash.udev.cdc.com + Arden Hills MN 55126 USA