Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!nr3m From: nr3m@unix.cis.pitt.edu (Matthew A Henry) Newsgroups: comp.unix.questions Subject: Working with sed Message-ID: <27372@unix.cis.pitt.edu> Date: 9 Aug 90 20:45:56 GMT References: <994@netmbx.UUCP> <13513@smoke.BRL.MIL> Reply-To: nr3m@unix.cis.pitt.edu (Matthew A Henry) Organization: Univ. of Pittsburgh, Comp & Info Services Lines: 24 Hi, I'm writing a script that uses sed, and am having trouble with one part. I have a file that contains typical unix paths, one per line, and would like to remove everything after the last forward slash (/). In other words I would like the string: /aaa/bbb/ccc/ddd/eee to be changed to: /aaa/bbb/ccc/ddd Is this possible with sed? Any ideas e-mailed or posted would be greatly appreciated. Thanks, Matt Henry NR3M (412) 443-5071 ...![allegra, bellcore, cadre, idis, psuvax1]!pitt!cisunx!nr3m NR3M@PITTUNIX nr3m@unix.cis.pitt.edu