/ Published in: Bash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function term () { terms=`/bin/ls ~/Library/Application\ Support/Terminal/|grep -v ".*~"` if [ $# != 0 ] ; then let "count=0" for aterm in $terms; do termarray[$count]=$aterm let "count=$count+1" done selection=$1 else let "count=0" for aterm in $terms; do case "$aterm" in [0-9]*) ;; * ) termarray[$count]="$aterm" echo "$count: ${termarray[$count]}" let "count=$count+1" ;; esac done echo -n "Select term color: " read selection >/dev/null fi open -a /Applications/Utilities/Terminal.app ~/Library/Application\ Support/Terminal/${termarray[$selection]} }