воскресенье, 1 января 2017 г.

погода в терминале linux

#!/bin/bash
# Санкт-Петербург
#URL='http://www.accuweather.com/ru/ru/saint-petersburg/295212/weather-forecast/295212'
# Братск
#URL='http://www.accuweather.com/ru/ru/-/288008/weather-forecast/288008'
# Ростов на Дону
URL='http://www.accuweather.com/ru/ru/rostov-on-don/295146/weather-forecast/295146'

wget -q -O- "$URL" > /tmp/pogoda

TEMP=$(cat /tmp/pogoda | grep "large-temp" | tail -n 1 | sed 's/^..................................................................//' | sed 's/.............$//')
GORO=$(cat /tmp/pogoda | grep "current-city" | grep "span" | sed 's/^...................................................................//' | sed 's/.....................$//')
OSAD=$(cat /tmp/pogoda | grep "span class" | grep "cond" | head -n 1 | sed 's/^...........................................................//' | sed 's/........$//')

echo " $GORO $TEMP $OSAD"

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

Отправить комментарий

h265.sh

#!/bin/bash file="../mp4" if [ -d $file ]; then         echo "  Директория существует :-) "         for i in *.mp4; do f...