I wanted to do a string replacing with bash , which will find the parent path from the current running program’s path.
So i tried to removing everything , from the last ‘/’ to the end with regular expression:
echo ${0#/.*#}
But it’s not working , and please don’t let me use external programs , it’s better getting everything with bash…
Thanks !
Do you mean something like this –