Skip to content
Back to skills

1 Always Use Set E

ASecurity

Sub-skill of bash-cli-framework: 1. Always Use `set -e` (+4).

  • 17 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
toolsgobash

Works with

  • cli

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 1-always-use-set-e --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1 Always Use Set E?

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

Security grade badge for 1 Always Use Set E
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-1-always-use-set-e/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-1-always-use-set-e)

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: bash-cli-framework-1-always-use-set-e
description: 'Sub-skill of bash-cli-framework: 1. Always Use `set -e` (+4).'
version: 1.0.0
category: _core
type: reference
scripts_exempt: true
---

# 1. Always Use `set -e` (+4)

## 1. Always Use `set -e`

Exit immediately if a command exits with non-zero status:
```bash
set -e
# Or for more control:
set -euo pipefail
```


## 2. Quote Variables

Always quote variables to prevent word splitting:
```bash
# Good
echo "$variable"
"$command" "$arg1" "$arg2"

# Bad
echo $variable
$command $arg1 $arg2
```


## 3. Use Meaningful Exit Codes

```bash
# Exit codes
EXIT_SUCCESS=0
EXIT_ERROR=1
EXIT_USAGE=2
EXIT_CONFIG=3
```


## 4. Provide Feedback

Always tell the user what's happening:
```bash
log_info "Starting process..."
# do work
log_info "Process complete (processed $count items)"
```


## 5. Support Dry Run

Let users preview changes:
```bash
if [[ $DRY_RUN == true ]]; then
    log_info "[DRY RUN] Would execute: $command"
else
    eval "$command"
fi
```

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.

Comments

Loading comments…

Newsletter

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