Working with sed

David Neill-OKCy Mktg 405-278-4007 dwn at swbatl.sbc.com
Sat Aug 11 03:43:33 AEST 1990


>In article <27372 at unix.cis.pitt.edu> nr3m at unix.cis.pitt.edu (Matthew A Henry) writes:
>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 (/).

sed -e 's/\/[^\/]*$//' filename

-- 
name & address   (this account) -> uunet!swbatl!dwn OR dwn at swbatl.sbc.com
David Neill       office -> 405-291-1990 -> uunet!swbatl!oktext!mktco
Mgr - Mktg.(SWBTCo) home -> 405-749-1141 -> uunet!swbatl!oktext!frodo!david



More information about the Comp.unix.questions mailing list