Skip to content
Back to skills

Bash Scripting 1

ASecurity

Instructions in case if any bash (or any shell in general) script is needed.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsgoshellbash

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill bash-scripting-1 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bash Scripting 1?

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

Security grade badge for Bash Scripting 1
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-bash-scripting-1/badge)](https://www.skillsdirectory.com/skills/david-li0406-bash-scripting-1)

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-scripting
description: Instructions in case if any bash (or any shell in general) script is needed.
---

When determining where script is if needed, always use

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if refering something from ROOT directory is needed then define ROOT based on DIR in relative manner from current script like:

ROOT="${DIR}/.."

or

ROOT="${DIR}/../.."

... depends how many directories up we have to go

Don't use shebang at the top of the file.

Call script like this:

/bin/bash ${DIR}/script.sh

When using variables always surround them with ${}.

never $DIR, always ${DIR}

# error handling

Before exit with non zero exit code from script in case of error always print the message what's happened like so:

echo "${0} error: [and then message here]"

this way we will spit out information about origin of the error - when it comes to which script is it.

Add to the message any relevent parameters values like so

"name of env var MY_ENV_VAR=>${MY_ENV_VAR}<"

(surround with ><, this way I will see any whitespaces at the beginning or end of the value)

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…