Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!ncar!ames!sgi!shinobu!odin!giraffe.asd.sgi.com!pj From: pj@giraffe.asd.sgi.com (Paul Jackson) Newsgroups: comp.sys.sgi Subject: Re: Problem with csplit ..... Message-ID: <1990Oct2.010342.13036@odin.corp.sgi.com> Date: 2 Oct 90 01:03:42 GMT References: <218*finn.drablos@sintef.no> Sender: news@odin.corp.sgi.com (Net News) Reply-To: pj@sgi.com Organization: Silicon Graphics, Research & Development Lines: 28 In article <218*finn.drablos@sintef.no>, finn.drablos@sintef.no (Finn Drablos) writes: |> I have a source code file with several subroutines. Each subroutine is |> started with a comment line with 'BEGIN '. |> |> Now I want to split this into separate files with csplit, and as I |> understand the man page the following command should work : |> |> csplit -k source.src /BEGIN/ {40} |> |> However, it seems to split up to the first BEGIN, and then the next 40 |> lines. It does not use the pattern 40 times. I have tried /BEGIN/{40}, |> '/BEGIN/ {40}', '/BEGIN/{40}', '/BEGIN/+0 {40}', '/BEGIN/+0{40}', |> '/BEGIN/'{40} etc. ... The csh strips off the unquoted { } characters, so that the actual argument seen by csplit is a simple 40, which is taken as a line number. Try: csplit -k source.src /BEGIN/ '{40}' where the single quotes protect the { } characters. Your other attempts mostly tried to force the /BEGIN/ and the {40} into a single argument, which is not what you want. -- Thanks, take care ... Paul Jackson (pj@asd.sgi.com), x1373