← All skills
Tencent SkillHub · Finance & Trading

Bash

Avoid common Bash mistakes — quoting traps, word splitting, and subshell gotchas.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Avoid common Bash mistakes — quoting traps, word splitting, and subshell gotchas.

⬇ 0 downloads ★ 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md, arrays.md, errors.md, expansion.md, testing.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.2

Documentation

ClawHub primary doc Primary doc: SKILL.md 10 sections Open source page

Quick Reference

TopicFileArrays and loopsarrays.mdParameter expansionexpansion.mdError handling patternserrors.mdTesting and conditionalstesting.md

Quoting Traps

Always quote variables—"$var" not $var, spaces break unquoted "${arr[@]}" preserves elements—${arr[*]} joins into single string Single quotes are literal—'$var' doesn't expand Quote command substitution—"$(command)" not $(command)

Word Splitting and Globbing

Unquoted $var splits on whitespace—file="my file.txt"; cat $file fails Unquoted * expands to files—quote or escape if literal: "*" or \* set -f disables globbing—or quote everything properly

Test Brackets

[[ ]] preferred over [ ]—no word splitting, supports &&, ||, regex [[ $var == pattern* ]]—glob patterns without quotes on right side [[ $var =~ regex ]]—regex match, don't quote the regex -z is empty, -n is non-empty—[[ -z "$var" ]] tests if empty

Subshell Traps

Pipes create subshells—cat file | while read; do ((count++)); done—count lost Use while read < file or process substitution—while read; do ...; done < <(command) ( ) is subshell, { } is same shell—variables in ( ) don't persist

Exit Handling

set -e exits on error—but not in if, ||, && conditions set -u errors on undefined vars—catches typos set -o pipefail—pipeline fails if any command fails, not just last trap cleanup EXIT—runs on any exit, even errors

Arrays

Declare: arr=(one two three)—or arr=() then arr+=(item) Length: ${#arr[@]}—not ${#arr} All elements: "${arr[@]}"—always quote Indices: ${!arr[@]}—useful for sparse arrays

Parameter Expansion

Default value: ${var:-default}—use default if unset/empty Assign default: ${var:=default}—also assigns to var Error if unset: ${var:?error message}—exits with message Substring: ${var:0:5}—first 5 chars Remove prefix: ${var#pattern}—## for greedy

Arithmetic

$(( )) for math—result=$((a + b)) (( )) for conditions—if (( count > 5 )); then No $ needed inside $(( ))—$((count + 1)) not $(($count + 1))

Common Mistakes

[ $var = "value" ] fails if var empty—use [ "$var" = "value" ] or [[ ]] if [ -f $file ] with spaces—always quote: if [[ -f "$file" ]] local in functions—without it, variables are global read without -r—backslashes interpreted as escapes echo portability—use printf for reliable formatting

Category context

Trading, swaps, payments, treasury, liquidity, and crypto-financial operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
5 Docs
  • SKILL.md Primary doc
  • arrays.md Docs
  • errors.md Docs
  • expansion.md Docs
  • testing.md Docs