Skip to content

Instantly share code, notes, and snippets.

@gin135
Last active January 10, 2017 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gin135/c3d7c1c9cb771e0335d40533205e4a67 to your computer and use it in GitHub Desktop.
Save gin135/c3d7c1c9cb771e0335d40533205e4a67 to your computer and use it in GitHub Desktop.
全元号リストをシェル芸で出力するやつ
#!/bin/sh
w3m -dump -cols 200 'https://ja.wikipedia.org/wiki/%E5%85%83%E5%8F%B7%E4%B8%80%E8%A6%A7_(%E6%97%A5%E6%9C%AC)' 2>/dev/null |
grep '[ :][0-9]\{1,2\}年[ ^]' |
grep -v '定められず' |
sed '$d' |
awk '$0=$1'
@gin135
Copy link
Author

gin135 commented Jan 10, 2017

元号は全部で245個?

@gin135
Copy link
Author

gin135 commented Jan 10, 2017

@ebanさんの指摘を受けて、コードを修正。
https://twitter.com/eban/status/818723445353525248

元号は全部で247個だったorz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment