help 253 B

1234567891011121314151617
  1. #!/bin/bash
  2. cd $(dirname $0)
  3. echo Targets:
  4. for i in *; do
  5. if [ ! -x $i ] || [ ! -f $i ]; then
  6. continue
  7. fi
  8. MSG=$(grep '^# help:' $i)
  9. if [ -n "$MSG" ]; then
  10. echo " " ${i}: $(echo $MSG | sed 's/# help://')
  11. fi
  12. done