Re: Need help with sed statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Mon, May 3, 2010 at 11:37 PM, David Bartmess <[email protected]> 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.
> I tried using the following, but it still gives me the entire string:

To do it in sed:

[[email protected] ~]$ echo /foo/bar/goo|sed -e 's:^.*/::'

Keep in mind that the delimiter character is arbitrary. This makes
substitution of filenames lots easier.
users mailing list
[email protected]
To unsubscribe or change subscription options:

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux