0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

yahoo株式 ある特定銘柄をコマンドラインでみるシェル

Posted at

xxxx.Tは、銘柄コードです。jqコマンドのインストールが必要です。

--- file ---
#!/bin/bash
cur=$(curl -s https://finance.yahoo.co.jp/quote/xxxx.T|sed 's/[&;"]/\n/g'|grep stock_price|uniq|grep -o '[0-9]+')
echo $cur
pre=$(curl -s https://finance.yahoo.co.jp/quote/xxxx.T|grep -m1 PRELOADED|sed s/window.PRELOADED_STATE//|sed s/=//|jq|grep closePrice|tail -1|grep -o '[0-9]+')
echo $pre
echo $((cur-pre))

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?