You have a few options here. My preference would be towards a parameter expansion:
foo=dir/foo
echo "${foo%/*}./"
Another option is awk:
echo "dir/foo" | awk -F/ '{ print $1"./" }'
You have a few options here. My preference would be towards a parameter expansion:
foo=dir/foo
echo "${foo%/*}./"
Another option is awk:
echo "dir/foo" | awk -F/ '{ print $1"./" }'