понедельник, 19 октября 2015 г.

easy array listing on bash

 #!/bin/bash  
 declare -A STATION  
 STATION["CBS San Francisco"] = "http://2133.live.streamtheworld.com:80/KCBSFMDIALUP_SC"  
 STATION["WAAL 99.1 FM"]="http://1531.live.streamtheworld.com:80/WAALFMAAC_SC"  
 STATION["News Talk Radio 77"]="http://8703.live.streamtheworld.com:80/WABCAM_SC"  
 STATION["WFAN Sports Radio - AM 660"] = "http://8703.live.streamtheworld.com:80/WFANAMDIALUP_SC"  
 STATION["The Lake - WLKK - FM 107.7"] = "http://3143.live.streamtheworld.com:80/WLKKFM_SC"  
  clear  
  echo "Select radio station:"  
  select ENTRY in "${!STATION[@]}"; do  
   TITLE="${ENTRY}"  
   URL=${STATION[${ENTRY}]}  
   ffplay -x 300 -y 100 -window_title "${TITLE}" ${URL} &>/dev/null  
  done  

Комментариев нет: