Plan 9 from Bell Labs’s /n/sources/patch/sorry/mkdirlist/mkdirlist
#!/bin/rc for(i in $*) if(~ $i */*) basename -d $i