fish-shell-scripting
Fish Shell Scripting
Related skills:
software-engineer- General scripting design principlespython-programmer- When shell complexity exceeds ~100 lines, consider Python
<core_philosophy> Fish is a user-friendly shell that prioritizes correctness over POSIX compatibility. Its lists-not-strings semantics eliminates entire classes of bugs common in bash/zsh. The limitation is portability, not capability.
Key insight: Fish handles sophisticated automation well. Choose Fish when you control the environment; choose bash when you don't. </core_philosophy>
Platform Requirements
<platform_requirements>
Compatibility: All Fish scripts MUST work on both macOS and Fedora Linux. Handle platform differences via uname detection.
Quote paths with spaces: Always quote file paths even though Fish has no word splitting. Fish doesn't need quotes technically (no word splitting), but quoting anyway: (1) makes intent explicit for readability, (2) builds consistent habits when switching between shells, (3) ensures compatibility when passing to external commands that may interpret spaces.