Select terminal file


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function term () {
  2. terms=`/bin/ls ~/Library/Application\ Support/Terminal/|grep -v ".*~"`
  3. if [ $# != 0 ] ; then
  4. let "count=0"
  5. for aterm in $terms; do
  6. termarray[$count]=$aterm
  7. let "count=$count+1"
  8. done
  9. selection=$1
  10. else
  11. let "count=0"
  12. for aterm in $terms; do
  13. case "$aterm" in
  14. [0-9]*) ;;
  15. * )
  16. termarray[$count]="$aterm"
  17. echo "$count: ${termarray[$count]}"
  18. let "count=$count+1"
  19. ;;
  20. esac
  21. done
  22. echo -n "Select term color: "
  23. read selection >/dev/null
  24. fi
  25. open -a /Applications/Utilities/Terminal.app ~/Library/Application\ Support/Terminal/${termarray[$selection]}
  26. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.