Ruby では、あるディレクトリ直下のディレクトリだけをソートして、
", "(カンマと空白)でつなげて、1行の文字列にしたものは、

ruby -e 'puts Dir.glob( "*" ).select{ |file| File.directory? file }.sort.join( ", " )'

出力
app, bin, config, db

これをシェルスクリプトでは、どう作るの?
これらを使うの?

ls -d */
find . -maxdepth 1 -type d