[NTLUG:Discuss] scripting question

Monty Shinn montys at videopost.com
Wed Apr 20 13:15:59 CDT 2011


Greetings.

I am trying to delete part of a line that is actually a directory path 
in a file with multiple lines.

The paths in the file looks like this:

/usr/test/working/access/hbr/filename.plist.
/usr/test/working/access/mbr/filename.plist.
/usr/test/working/access/lbr/filename.plist.

I am wanting the paths in the file to end up like this:

access/hbr/filename.plist
access/mbr/filename.plist
access/lbr/filename.plist

I have monkeyed around with sed to no avail.  Can't seem to get it to 
match the pattern I want it to.  I was able to get grep to see the 
pattern using grep -E, but can't figure out how to do anything with the 
output.

I am trying to do this inside a bash script.

Google is just confusing me all the more...

Any help would be greatly appreciated.

Thanks,

Monty



More information about the Discuss mailing list