To:
/directoryname1/subdirectoryname1/
/directoryname2/subdirectoryname2/
I could not trigger the beginning of the string as they varies. Right now,
I'm using SED to try and catch /*.txt and repalce it with nothing but i don't seem to get it to work.
$path = /var/tmp/123.txt
echo $path | sed 's/\/*\.txt//'
Outputs:
/var/tmp/123
$path = /var/tmp/123.txt
echo $path | sed 's/\/\*txt//'
Outputs:
/var/tmp/123.txt (does nothing)
I'm just tyring to replace "/*.txt" to " "(nothing). Hope you guys can help me on that.
Thanks in advance.