Re: modifing a path (string)

Re: modifing a path (string)

am 29.12.2007 16:10:57 von Bobby.Higgins

Using the shell "Remove Large Left Pattern"
The initial assignment
dirF=/dirA/dirB/dirC/dirD/dirF
could be modified using:
echo "./${dirF##*/}"
The output would be:
../dirF

This should work with ksh, dtksh, and bash.

wrote in message
news:92d0c268-1611-4db8-90c7-fa64e969313f@e25g2000prg.google groups.com...
>I need to modify a path sttring thats in a file and looks like this:
>
> before :
>
> define dirF /dirA/dirB/dirC/dirD/dirF
>
> after
>
> define dirF ./dirF
>
> basically, remove all of the path string except for the last portion
>
> Thanks
>
> RIck