I needed to create a ton of commands today for the GitHub Bot integration for Slack.
Essentially what it boiled down to is string concatenation from STDIN outputting what was in my Repository directory in conjunction with the bot command.
Result is below:
find -d -maxdepth 1 | sed 's/\.\///g' | sort | while read repository; do echo "/github subscribe getbenjamin/$repository pulls releases"; done
# Example Output against the /var directory (not sharing our repo names publicly for security reasons ;-) ):
# /github subscribe getbenjamin/. pulls releases
# /github subscribe getbenjamin/backups pulls releases
# /github subscribe getbenjamin/cache pulls releases
# /github subscribe getbenjamin/crash pulls releases
# /github subscribe getbenjamin/lib pulls releases
# /github subscribe getbenjamin/local pulls releases
# /github subscribe getbenjamin/lock pulls releases
# /github subscribe getbenjamin/log pulls releases
# /github subscribe getbenjamin/mail pulls releases
# /github subscribe getbenjamin/opt pulls releases
# /github subscribe getbenjamin/run pulls releases
# /github subscribe getbenjamin/snap pulls releases
# /github subscribe getbenjamin/spool pulls releases
# /github subscribe getbenjamin/tmp pulls releases
# /github subscribe getbenjamin/www pulls releases