fun 259 B

123456789101112
  1. #!/bin/sh
  2. case $# in
  3. 1) sed -n /function.$1/,/}/p *; sed -n /proc.$1/,/}/p *; sed -n /sub.$1/,/}/p *;
  4. ;;
  5. 2) sed -n /function.$1/,/}/p $2; sed -n /proc.$1/,/}/p $2; sed -n /sub.$1/,/}/p $2;
  6. ;;
  7. *) echo "usage: fun fctname [filename]?"
  8. exit 1
  9. ;;
  10. esac
  11. exit 0