Skip to content

Improve shell script functionality#410

Open
nbeerbower wants to merge 2 commits into
mainfrom
claude/improve-shell-script-veRUe
Open

Improve shell script functionality#410
nbeerbower wants to merge 2 commits into
mainfrom
claude/improve-shell-script-veRUe

Conversation

@nbeerbower

Copy link
Copy Markdown
Collaborator

New functions:

  • sh(cmd): Run shell string directly, return stdout (throws on failure)
  • sh_ok(cmd): Run shell string, return bool success status
  • last_exit(): Get exit code from last sh/sh_ok call
  • range(start, end, step?): Generate numeric ranges like {1..10}
  • char_range(start, end): Generate character ranges like {a..z}
  • expand(pattern): Bash-style brace expansion

Features:

  • List expansion: {a,b,c} -> ["a", "b", "c"]
  • Numeric ranges: {1..5} -> ["1", "2", "3", "4", "5"]
  • Character ranges: {a..f} -> ["a", "b", "c", "d", "e", "f"]
  • With prefix/suffix: file{1..3}.txt -> ["file1.txt", ...]
  • Cartesian product: {a,b}{1,2} -> ["a1", "a2", "b1", "b2"]
  • Zero-padding: {01..05} -> ["01", "02", "03", "04", "05"]
  • Step ranges: {1..10..2} -> ["1", "3", "5", "7", "9"]

Includes parity tests and updated documentation.

New functions:
- sh(cmd): Run shell string directly, return stdout (throws on failure)
- sh_ok(cmd): Run shell string, return bool success status
- last_exit(): Get exit code from last sh/sh_ok call
- range(start, end, step?): Generate numeric ranges like {1..10}
- char_range(start, end): Generate character ranges like {a..z}
- expand(pattern): Bash-style brace expansion

Features:
- List expansion: {a,b,c} -> ["a", "b", "c"]
- Numeric ranges: {1..5} -> ["1", "2", "3", "4", "5"]
- Character ranges: {a..f} -> ["a", "b", "c", "d", "e", "f"]
- With prefix/suffix: file{1..3}.txt -> ["file1.txt", ...]
- Cartesian product: {a,b}{1,2} -> ["a1", "a2", "b1", "b2"]
- Zero-padding: {01..05} -> ["01", "02", "03", "04", "05"]
- Step ranges: {1..10..2} -> ["1", "3", "5", "7", "9"]

Includes parity tests and updated documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants