Need help with sed statement

Kwan Lowe kwan at digitalhermit.com
Tue May 4 03:41:30 UTC 2010


On Mon, May 3, 2010 at 11:37 PM, David Bartmess <dingodave at edingo.net> wrote:
> Not sure if this is the right place, but I need help with a sed
> replacement expression.
>
> I'm trying to express only the filename from a filepath, i.e.,
> whoopie.txt from /opt/dev/whoopie.txt.
>
> Basically I'm reading the files that changed into a temp file, and
> reading each line into a variable to split out the base filename to act
> upon.

Use the basename command?

E.g.:

$ basename /foo/bar/goo
goo


More information about the users mailing list