#!/bin/bash for f in `find "./portdir/" -mindepth 2 -maxdepth 2 -type d`; do echo ${f#./portdir/} done > gen_source_pkgs.list