Those who survive a long time on the battlefield start to think they are invincible. / 不死身のエースってのは戦場に長く居たものの過信だ。 I bet you do too, buddy. / お前のことだよ相棒。 ――Ace Combat Zero
『メリー・ポピンズ・リターンズ』の『本は表紙じゃ分からない/Cover is not the Book』に曰く
Cover is not the book / 心が目に見えないように本も So open it up and take a look / 表紙の美しさに騙されちゃダメ 'Cause under the covers one discovers / 中身読んだらやさしい王様 That the king may be a crook / 詐欺師だとわかるかも
おおよそ道具というものは使ってなんぼ、壊れてなんぼという考えです。なので、「書く」という「思考を伝達する道具」の替えが効かないというのは、それ自体が単一障害点(SPOF: Single Point of Failure):その部分に障害が発生すると、システム全体が停止してしまうような、代替手段のない単一の要素になります。
“Sleep no more! Macbeth does murder sleep” — the innocent sleep, Sleep that knits up the ravelled sleave of care, The death of each day's life, sore labour's bath, Balm of hurt minds, great nature's second course, Chief nourisher in life's feast.
#!/bin/bash
# Show weather information. Change the city name to fit your location
ansiweather -l City1 -s true -d true -a false
ansiweather -l City2 -s true -d true -a false
echo "CAST IN NAME OF GOD, YE NOT GUILTY."
# 現在の言語ロケールを保存します。
original_locale=$(locale | grep "LANG=" | cut -d= -f2)
# ロケールを英語に修正します。
export LANG="en_US.UTF-8"
# ロサンゼルス(カリフォルニア)の曜日を調べます。
day_of_week=$(TZ="America/Los_Angeles" date +"%A")
# 金曜日だった場合のみメッセージを表示します。
if [ "$day_of_week" == "Friday" ]; then
echo "Today is Friday in California."
fi
# 元の言語ロケールに戻します。
export LANG="$original_locale"
ruby /home/user/script/ruby/ssl_checker.rb domain1.example.com domain2.example.com domain3.example.com
bash /home/user/script/bbc_headline.sh
#!/bin/bash
# デフォルト値の設定
default_section="world"
default_count=3
# メインセクションのリスト
main_sections=("world" "uk" "business" "politics" "health" "education" "science_and_environment" "technology" "entertainment_and_arts")
# グローバルセクションのリスト
global_sections=("africa" "asia" "europe" "latin_america" "middle_east" "us_and_canada")
# 全セクションのリストを統合
all_sections=("${main_sections[@]}" "${global_sections[@]}")
# 引数の処理
if [[ "$1" =~ ^[0-9]+$ ]]; then
section=$default_section
count=$1
else
section=${1:-$default_section} # 引数1が指定されていない場合はデフォルト値を使用
count=${2:-$default_count} # 引数2が指定されていない場合はデフォルト値を使用
fi
# 引数の短縮形を対応する正式名に変換
case "$section" in
"usa" | "n-usa") section="us_and_canada" ;;
"me") section="middle_east" ;;
"latam" | "la") section="latin_america" ;;
"eu") section="europe" ;;
"science") section="science_and_environment" ;;
"entertainment") section="entertainment_and_arts" ;;
*) section=$section ;; # その他はそのまま
esac
# セクションの検証
if [[ ! " ${all_sections[@]} " =~ " ${section} " ]]; then
echo "Error: Invalid section '${section}'. Valid sections are: ${all_sections[*]}"
exit 1
fi
# URLの構築
if [[ " ${main_sections[@]} " =~ " ${section} " ]]; then
url="https://feeds.bbci.co.uk/news/${section}/rss.xml"
else
url="https://feeds.bbci.co.uk/news/world/${section}/rss.xml"
fi
# 最初に一度だけRSSフィードをダウンロードし、変数に格納する
xml_content=$(curl -s "$url")
# コンテンツが取得できなかった場合はエラー終了
if [ -z "$xml_content" ]; then
echo "Error: No headlines found for section '${section}'. Please check the section name or try again later."
exit 1
fi
# フィードの最終更新日時を取得し、フォーマットする
# 2>/dev/null は、xmllintが出す軽微なエラーを非表示にするため
feed_date_raw=$(echo "$xml_content" | xmllint --xpath "string(//channel/lastBuildDate)" - 2>/dev/null)
if [ -n "$feed_date_raw" ]; then
# JSTに変換して表示フォーマットを整える
feed_date_formatted=$(date -d "$feed_date_raw" '+%Y/%m/%d %H:%M:%S %Z')
fi
# 見出しを取得
headlines=$(echo "$xml_content" | xmllint --xpath "//item/title/text()" - 2>/dev/null | sed -e 's/<!\[CDATA\[//g' -e 's/\]\]>//g' | head -n "$count")
# 見出しの表示
echo "BBC News - ${section} section (${count} headlines)"
# 取得した日付を表示
if [ -n "$feed_date_formatted" ]; then
echo "As of: ${feed_date_formatted}"
fi
echo "--------------------------------------------------" #区切り線
echo "$headlines"
これは
./bbc_headline.sh
とすることで
BBC News - asia section (7 headlines)
As of: 2025/11/02 20:04:03 JST
--------------------------------------------------
300 million tourists just visited China's stunning Xinjiang region. There's a side they didn't see
Devastation on repeat: How climate change is worsening Pakistan's deadly floods
Shein accused of selling childlike sex dolls in France
Cruise cancelled following death of woman left behind on island
From the fringe to the final - India's phenomenon
Why the Indian passport is falling in global ranking
China to loosen chip export ban to Europe after Netherlands row
等の表示が可能になります。
この、日付とニュースの同時表示というのは
「このときにこんなニュースがあった」と、日付と行動の紐付け並びに重要なフックが可能になります。
やや強引なまとめ
と、スクリプトはちょっとした知識とAIの助けがあれば構築可能なものばかりではありますが、
冒頭に掲げた
Spoonful sugar helps medicine goes down(スプーン一杯の砂糖で苦い薬も平気で飲める)