Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. echo Привет, `whoami`
  2. cnt=0
  3. trap 'cnt=$(( $cnt + 1 ))' SIGINT
  4. while [ $cnt -lt 3 ]
  5. do
  6.     read q
  7.     if [[ "$q" =~ .*"Найди мне".* ]]
  8.     then
  9.         search=${q#*Найди мне }
  10.         search=${search// /+}
  11.         echo 'https://www.google.com/search?q='$search
  12.     fi
  13.     if [[ "$q" =~ .*"Погода".* ]]
  14.     then
  15.         search=${q#Погода }
  16.         curl "http://wttr.in/$search"
  17.     fi
  18.     if [[ "$q" =~ .*"Время".* ]]
  19.     then
  20.         echo Сейчас `date`
  21.     fi
  22. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement