shell 天气预报
shell 天气预报
2023-09-11 14:15:45 时间
Shell 天气预报
tags: 监控
weather.sh
#!/bin/bash
# weather.sh
# Copyright 2018 computer-geek64. All rights reserved.
program=Weather
version=1.1
year=2018
developer=computer-geek64
case $1 in
-h | --help)
echo "$program $version"
echo "Copyright $year $developer. All rights reserved."
echo
echo "Usage: weather [options]"
echo "Option Long Option Description"
echo "-h --help Show the help screen"
echo "-l [location] --location [location] Specifies the location"
;;
-l | --location)
curl https://wttr.in/$2
;;
*)
curl https://wttr.in
;;
esac
执行:
$ bash weather.sh -h
Weather 1.1
Copyright 2018 computer-geek64. All rights reserved.
Usage: weather [options]
Option Long Option Description
-h --help Show the help screen
-l [location] --location [location] Specifies the location
$ bash weather.sh
$ bash weather.sh -l shanghai
相关文章
- Find or Query Data with the mongo Shell
- 《树莓派渗透测试实战》——2.9 通过SSH做反向Shell
- SHELL脚本--shell数组基础
- Shell语法中的test命令用法
- Shell中的数值计算
- 01-01基于SHELL的数据分析
- shell如何快速执行上一个命令的最后一个参数
- Shell监控磁盘并发送邮件
- 《Linux命令行与shell脚本编程大全 第3版》高级Shell脚本编程---41
- 《Linux命令行与shell脚本编程大全 第3版》高级Shell脚本编程---32
- 《Linux命令行与shell脚本编程大全 第3版》高级Shell脚本编程---27
- 《Linux命令行与shell脚本编程大全 第3版》高级Shell脚本编程---07
- 《Linux命令行与shell脚本编程大全 第3版》高级Shell脚本编程---03
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---52
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---47
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---44
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---26
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---12
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---11