perl -le '$t="/b"; if ($t =~/^(+*?)\//){$z=$1}elsif($t=~/\/(.*)/){$z=$1} print $z'