Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/chaterm/terminal-skills/shell-scriptingnpx skills add chaterm/terminal-skills --skill shell-scriptinggit clone --depth 1 https://github.com/chaterm/terminal-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/chaterm/terminal-skills/shell-scripting)<a href="https://agentmods.dev/skills/chaterm/terminal-skills/shell-scripting"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/shell-scripting.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00013 | $0.01884 |
| Opus 5 | $0.00006 | $0.00942 |
| Sonnet 5 | $0.00003 | $0.00377 |
| Haiku 4.5 | $0.00001 | $0.00188 |
Grade A, and why
shell-scripting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 361 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shell 脚本编写
概述
Bash 脚本编写、调试、最佳实践等技能。
基础语法
脚本结构
#!/bin/bash
# 脚本描述
# Author: name
# Date: 2024-01-01
set -euo pipefail # 严格模式
# 变量定义
VAR="value"
readonly CONST="constant"
# 主逻辑
main() {
echo "Hello, World!"
}
main "$@"
变量
# 定义变量
name="value"
name='literal value' # 不解析变量
# 使用变量
echo $name
echo ${name}
echo "${name}_suffix"
# 默认值
${var:-default} # 未设置时使用默认值
${var:=default} # 未设置时赋值并使用
${var:+value} # 已设置时使用 value
${var:?error message} # 未设置时报错
# 字符串操作
${#var} # 长度
${var:0:5} # 子串
${var#pattern} # 删除前缀
${var%pattern} # 删除后缀
${var/old/new} # 替换
数组
# 定义数组
arr=(a b c d)
arr[0]="first"
# 访问数组
${arr[0]} # 第一个元素
${arr[@]} # 所有元素
${#arr[@]} # 数组长度
${!arr[@]} # 所有索引
# 遍历数组
for item in "${arr[@]}"; do
echo "$item"
done
流程控制
条件判断
# if 语句
if [[ condition ]]; then
commands
elif [[ condition ]]; then
commands
else
commands
fi
# 条件表达式
[[ -f file ]] # 文件存在
[[ -d dir ]] # 目录存在
[[ -z "$var" ]] # 变量为空
[[ -n "$var" ]] # 变量非空
[[ "$a" == "$b" ]] # 字符串相等
[[ "$a" != "$b" ]] # 字符串不等
[[ $a -eq $b ]] # 数字相等
[[ $a -lt $b ]] # 小于
[[ $a -gt $b ]] # 大于
# 逻辑运算
[[ cond1 && cond2 ]] # 与
[[ cond1 || cond2 ]] # 或
[[ ! cond ]] # 非
循环
# for 循环
for i in 1 2 3 4 5; do
echo $i
done
for i in {1..10}; do
echo $i
done
for ((i=0; i<10; i++)); do
echo $i
done
for file in *.txt; do
echo "$file"
done
# while 循环
while [[ condition ]]; do
commands
done
# 读取文件
while IFS= read -r line; do
echo "$line"
done < file.txt
# until 循环
until [[ condition ]]; do
commands
done
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 361 lines · 13 tokens per session scan A 2875d42af1cf
shell-scripting is a skill published in the GitHub repository chaterm/terminal-skills (58 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,884 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
shell-scripting
Use this skill when writing bash or zsh scripts, parsing arguments, handling errors, or automating CLI workflows. Triggers on bash scripting, shell scripts, argument parsing, process substitution, here documents, signal trapping, exit codes, and any task requiring portable shell script development.
bash-scripting-safe
Write safe, robust Bash scripts — set -euo pipefail, quoting, word splitting, error handling, idempotency, and common data-loss gotchas.
rust-unit-tests
Write, improve, and run Rust unit tests in the warp Rust codebase.
warpctrl
Control and inspect the currently running local Warp application with the warpctrl CLI. Use this skill whenever the user asks the agent to manipulate Warp's own windows, tabs, panes, sessions, input buffer, themes, or UI surfaces; open a file in Warp; inspect local Warp state; or explain how to invoke Warp Control…
change-keybinding
Customize Warp keyboard shortcuts (keybindings, keymappings) by editing the user's keybindings.yaml file. Use when the user asks to remap a key combination, rebind an action, change a shortcut, or remove a default keybinding (e.g. "change ctrl+space to ctrl+s", "rebind the command palette to cmd+p", "remove the…
create-tab-config
Create new Warp tab config TOML files from natural-language requests. Use when the user wants a new tab config, a new tab layout, or asks for a slash command to generate a tab config.