modern-bash
Installation
SKILL.md
Modern Bash - The String Lisp
Core Philosophy: Bash = String Lisp
Bash的本质是字符串Lisp:
- 一切都是字符串 - 变量、输出、参数都是字符串
- 命令即函数 - 每个命令都是纯函数 (stdin → stdout)
- 管道即组合 -
|是函数组合操作符 - 命令替换即求值 -
$(...)是表达式求值 - 重定向即副作用 - 显式管理副作用
# Lisp思维: (compose (map f) (filter g) xs)
# Bash表达:
seq 1 100 | xargs -n1 | while read n; do echo $((n * 2)); done
# 函数组合: (f (g x))
result=$(echo "$input" | grep pattern | wc -l)