CLI Tools
bash
Intermediate
New
Dotenv File Linter
Check .env files for common mistakes: duplicate keys, missing values, invalid characters.
bash
#!/bin/bash
FILE=${1:-.env}
errors=0
while IFS= read -r line; do
[[ -z "$line" || "$line" =~ ^# ]] && continue
if ! echo "$line" | grep -qP "^[A-Z0-9_]+="; then
echo "BAD KEY: $line"; ((errors++))
fi
key=$(echo "$line" | cut -d= -f1)
val=$(echo "$line" | cut -d= -f2-)
if [ -z "$val" ]; then
echo "EMPTY VALUE: $key"; ((errors++))
fi
done < "$FILE"
echo "$errors error(s) found in $FILE"
exit $errors
Prerequisites
- bash
Pro Tips
- → Run in pre-commit hook to catch issues before code review.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Intermediate
- Read time
- 2 min
- Published
- Aug 2026
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Rich Progress Bar Script
Display a beautiful progress bar in the terminal using Rich.
python
·
Beginner
Git Commit Message Enforcer
commit-msg hook that enforces Conventional Commits format.
bash
·
Intermediate
System Info Dashboard
Print a compact system summary: CPU, RAM, disk, OS and uptime in one script.
bash
·
Beginner