fix-line-endings

Fix CRLF (Windows) to LF (Unix) line endings in files. Use when encountering `/bin/bash: line 1: $'\r': command not found` errors.

⭐2stars🔀0forks📁View on GitHub🕐Updated Dec 2, 2025

When & Why to Use This Skill

This Claude skill provides an automated solution for converting Windows-style CRLF line endings to Unix-style LF line endings. It is specifically optimized to fix the common '/bin/bash: line 1: \r: command not found' error, ensuring that scripts and configuration files created on Windows function correctly in Linux, macOS, and other Unix-based environments.

Use Cases

  • Fixing execution errors in Bash scripts that were edited or created on Windows systems.
  • Standardizing line endings across a codebase to maintain consistency in multi-platform development teams.
  • Preparing shell scripts for deployment to Unix-based cloud servers or CI/CD pipelines to prevent runtime failures.
  • Cleaning up configuration files that cause parsing issues due to hidden carriage return characters.
namefix-line-endings
descriptionFix CRLF (Windows) to LF (Unix) line endings in files. Use when encountering `/bin/bash: line 1: $'\r': command not found` errors.

Fix Line Endings

Convert CRLF to LF line endings.

.claude/skills/fix-line-endings/scripts/fix-line-endings.sh file1.sh file2.sh

For combined fix + syntax check, use fix-line-endings-check-bash instead.