perl -e '$p="foo/bar/rab/oof";for (split ("/",$p)) {push(@p,"$o/$_");$o.="/$_"} print join("|",@p);'