sh

    sh command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.5
    License
    Apache-2.0
    Last updated
    4 days ago
    Downloads
    146

    #sh

    Run shell scripts and sessions for MoonX.

    moonx cli/sh@0.2.5 [-i] [-c SOURCE [NAME [ARG...]] | -s [ARG...] | FILE [ARG...]]

    #Supported scope

    This version accepts option parsing after -s, including --, before assigning stdin-script positional parameters. Dedicated exact cases cover both terminated and unterminated option lists.

    Supports quoting, variables/exports, substitutions, pipelines, redirections, conditionals, loops, functions and common builtins. Stdin sessions execute complete commands before EOF.

    #Options

    OptionDescription
    -c SOURCE [NAME [ARG...]]Execute source text.
    FILE [ARG...]Execute a script file.
    -s [ARG...]Read commands from stdin.
    -iEnable explicit interactive prompts and ENV startup.
    --help / --versionShow help / package version.

    #Limitations

    • This is a shell subset: no job control, background jobs, fd duplication, backticks, arithmetic assignment/increment/ternary, or full Bash/POSIX compatibility.
    • No automatic TTY detection, line editing or recoverable Ctrl-C. exec/fg/bg/jobs/wait are rejected.
    • Here-documents support literal bodies; builtin printf supports a smaller format set than cli/printf.

    #Examples

    moonx cli/sh@0.2.5 -c 'echo hello' moonx cli/sh@0.2.5 script.sh

    Source Files