Skip to content

Add bash-to-rc syntax converter and comprehensive rc syntax guide for AI tools#3

Merged
danregima merged 3 commits intomasterfrom
copilot/next-steps-procedure
Mar 7, 2026
Merged

Add bash-to-rc syntax converter and comprehensive rc syntax guide for AI tools#3
danregima merged 3 commits intomasterfrom
copilot/next-steps-procedure

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

Implements the "next steps" from IMPLEMENTATION_SUMMARY.md: expand rc command generation support and add comprehensive syntax examples for AI tool developers.

New: bash-to-rc converter

examples/bash_to_rc_converter.py — importable Python module + CLI that translates common bash/sh patterns to rc equivalents:

$ echo 'for f in *.txt; do echo $f; done' | python3 examples/bash_to_rc_converter.py
for(f in *.txt) {
  echo $f
}

$ python3 examples/bash_to_rc_converter.py 'result=$(hostname)'
result = `{hostname}

Handles: command substitution, variable assignments/braces/length, for/while/if/elif/else control flow, function definitions, stderr redirection, shebang, and arithmetic expansion (flagged with awk alternative + TODO).

convert-to-rc.sh — thin shell wrapper for the converter.

New: RC syntax reference

RC_SYNTAX_GUIDE.md — dense bash↔rc side-by-side reference covering variables, control flow, functions, redirection, lists, error handling, and common AI-generated command patterns. Intended as a quick reference for AI tools generating rc commands.

Tests

Three new tests added to test-integration.sh (Tests 6–8): converter correctness for each major syntax pattern, wrapper sanity check, and guide presence/content validation.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 7, 2026 07:48
Co-authored-by: danregima <10253941+danregima@users.noreply.github.com>
Co-authored-by: danregima <10253941+danregima@users.noreply.github.com>
Copilot AI changed the title [WIP] Initiate next steps for project progression Add bash-to-rc syntax converter and comprehensive rc syntax guide for AI tools Mar 7, 2026
@danregima danregima marked this pull request as ready for review March 7, 2026 07:49
@danregima danregima merged commit 57ec840 into master Mar 7, 2026
7 checks passed
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