Getting a partial path to a file in a bash script

Posted by Massif on Stack Overflow See other posts from Stack Overflow or by Massif
Published on 2010-04-07T18:04:48Z Indexed on 2010/04/07 18:13 UTC
Read the original article Hit count: 191

Filed under:
|
|

I have a path that is stored in a variable

$FULLPATH="/this/is/the/path/to/my/file.txt"

I also have another variable containing a partial path

$PARTIAL="/this/is/the/"

I want to remove the partial path from the full path so that I am left with:

path/to/my/file.txt

What's the best way to do this?

© Stack Overflow or respective owner

Related posts about unix

Related posts about bash