Skip to content
Back to skills

Shell Dialects

ASecurity

Differences between bash, fish, and zsh. Parsers, pipeline status indexing, process substitution, exports, startup files. Use when checking or porting shell.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
ai-agentsshellbash

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add samuel-stidham/smithy --skill shell-dialects --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shell Dialects?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shell Dialects
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/samuel-stidham-shell-dialects/badge)](https://www.skillsdirectory.com/skills/samuel-stidham-shell-dialects)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shell-dialects
description: Differences between bash, fish, and zsh. Parsers, pipeline status indexing, process substitution, exports, startup files. Use when checking or porting shell.
---

# Shell dialects

The differences between bash, fish, and zsh that break ported
scripts. `portability` asks which distro breaks. This skill answers
the other question: which parser to run and which semantics apply.

Shell is two subjects, never one. **Script shell** is what `*.sh`
files and `writeShellApplication` derivations produce, bash in
practice, running unattended, owned by shellcheck. **Interactive
shell** is whatever login shell the configuration declares, plus its
config tree, where real logic often lives: status gates, process
substitution, secret loading. shellcheck sees none of it.

- **Parsers.** shellcheck cannot parse fish. On valid fish it exits
  1 and reports `SC1073 Couldn't parse this function`, so its
  findings on fish are false errors on correct code. Gate fish with
  `fish -n` (exit 0 clean, 127 on a syntax error) and zsh with
  `zsh -n` (exit 1 on a syntax error). Measured 2026-07-24 on one
  Linux workstation. Unverified elsewhere.
- **Pipeline status indexing.** bash `$PIPESTATUS` is zero-indexed:
  the first command is `[0]`. fish `$pipestatus` is one-indexed: the
  first command is `[1]`. zsh carries both, which is worse than
  carrying either. A script ported between them reads a real exit
  status from the wrong command and reports success. Measured
  2026-07-24, same caveat. This entry leads because the failure is
  silent and costly.
- **Process substitution.** `<(...)` in bash and zsh. It does not
  exist in fish, which needs `psub`: `-F` is the fifo, `-f` the
  default regular file.
- **Status and export.** `$?` against `$status`. `export VAR=x`
  against `set -gx VAR x`.
- **Startup files.** The login, interactive, and neither matrix
  decides which file runs. The systemd trap is its general form: a
  variable set in an interactive profile is invisible to anything a
  timer starts.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.