// Warum Thüringen ein Dorf ist

bash$ WP='https://de.wikipedia.org/wiki'

bash$ wget -qO- $WP/Dresden | grep -A1 '>Einwohner:<' | grep -Eo '[0-9\.]+ '

bash$ i=0 ; for CITY in Erfurt Jena Gera Weimar Suhl Apolda
> do
> i=$(bc <<< "$i + $(wget -qO- $WP/$CITY | grep -A1 '>Einwohner:<' | grep -Eo '[0-9\.]+ ')")
> done ; echo $i

Leave a comment…

  • E-Mail address will not be published.
  • Formatting:
    //italic//  __underlined__
    **bold**  ''preformatted''
  • Links:
    [[http://example.com|Link Text]]
  • Quotation:
    > This is a quote. Don't forget the space in front of the text: "> "
  • Code:
    <code>This is unspecific source code</code>
    <code [lang]>This is specifc [lang] code</code>
    <code php><?php echo 'example'; ?></code>
    Available: html, css, javascript, bash, cpp, …
  • Lists:
    Indent your text by two spaces and use a * for
    each unordered list item or a - for ordered ones.

Except where otherwise noted, content on this blog is licensed under CreativeCommons BY SA 3.0