-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I have a case, where I would like to retain the Directory Name of the File being dropped.
In that case, the TM_DROPPED_FILEPATH variable has the following value:
/Users/username/Sites/siteroot/public_html/textpattern/_templates/articles/article/60.an-example-article.txaml
I want to retain the last directory name, in this case: article.
I tried :
section=`echo $TM_DROPPED_FILE_PATH | perl -pe 's/(.*)?(/)(\w+)(/)([\d+]+)(.)(.*)$/$3/g'` echo "$section"
But the variable doesn't echo anything.
I tested the replacement pattern with find and replace and it gives me what I want.
What am I doing wrong here ?
Any help appreciated.
regards, marios