Re: modifing a path (string)

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.

<rickm [at] galaxy.nsc.com> wrote in message
news:92d0c268-1611-4db8-90c7-fa64e969313f [at] 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
Bobby.Higgins [ Sa, 29 Dezember 2007 16:10 ] [ ID #1895490 ]
Linux » comp.unix.shell » Re: modifing a path (string)

Vorheriges Thema: Re: Arrays doubts in KSH
Nächstes Thema: SED question: entering a blank line above a character searched and