LoginSignup
0
0

More than 3 years have passed since last update.

USD(米ドル)からJPY(日本円)に変換するシェル

Posted at

なんで作ったん

https://mwm-store.com/product/phase-essential
を欲しいなーと思ったがドルが安いときに書いたいなーと思い立った

良きAPIを見つけた方がいたので。
無料で使える為替取得APIメモ - Qiita

ソース

使い方

bash price_usd_to_jpy.sh USD(ドル) [メールで欲しい場合は宛先アドレス]

使用例

知りたいだけでメールはいらん人向け

$bash price_usd_to_jpy.sh 100
10570 yen
$

メールで送って欲しい人向け

$bash price_usd_to_jpy.sh 100 example@example.com

てやると、example@example.com 宛に以下のようなメールが届く

to : example@example.com
subject : [price report] 100 USD is 10570 yen . 
body:
100 USD is 10570 yen . 

のでcrontabに以下のように書いてやればいいんです

0 6 * * * /bin/nice -n 19 /bin/bash /home/example/price_usd_to_jpy.sh 100 example@example.com
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0