Skip to content

[Linux][CLI&UX] nemoclaw <sb> exec rejects multi-line bash heredocs with "command argument contains newline" — single-line / semicolon workaround works #5980

Description

@hulynn

Description

nemoclaw <sb> exec -- bash -lc '<heredoc>' rejects any multi-line content with the error × status: InvalidArgument, message: "command argument 2 contains newline or carriage return characters". This blocks the natural workflow of passing a small bash script to exec via a heredoc.

Single-line commands work fine, and the semicolon-joined workaround bash -lc "echo line1; echo line2" also works (outputs both lines). So this is a usability gap rather than a functional outage — but the InvalidArgument error message itself does NOT mention either workaround, leaving users to guess.

Environment

Device:        testnemoclaw 10.6.76.40 (Phase 5 scrub)
OS:            Ubuntu 26.04 no-GPU CPU sandbox path
Architecture:  x86_64
Node.js:       v22.22.3
npm:           10.x
Docker:        29.x
OpenShell CLI: openshell 0.0.44
NemoClaw:      v0.0.68
OpenClaw:      current release (2026.5.27)

Steps to Reproduce

  1. Onboard any sandbox (e.g. bug29test on 10.6.76.40, OpenClaw CPU path).

  2. Try a heredoc via exec:

    $ nemoclaw bug29test exec -- bash -lc 'cat <<EOF
      line1
      line2
      EOF'

    Observe: × status: InvalidArgument, message: "command argument 2 contains newline or carriage return characters".

  3. Confirm a single-line form works:

    $ nemoclaw bug29test exec -- bash -lc "echo single-line-test"
  4. Confirm the semicolon workaround works:

    $ nemoclaw bug29test exec -- bash -lc "echo line1; echo line2"

    Both lines print correctly.

Expected Result

Either:

  • (a) nemoclaw <sb> exec -- bash -lc '<heredoc>' accepts multi-line content and forwards it verbatim to the sandbox bash, OR
  • (b) the InvalidArgument error explicitly mentions the supported alternatives: "Multi-line commands are not supported via exec --. Use bash -lc \"cmd1; cmd2\" or pipe into the sandbox shell instead."

The user-visible error message should also point at the right command position so the user can spot the offending newline.

Actual Result

$ nemoclaw bug29test exec -- bash -lc 'cat <<EOF
line1
line2
EOF'
× status: InvalidArgument,
  message: "command argument 2 contains newline or carriage return characters"

No mention of the working alternatives (single-line, semicolon-joined, or piping via shell). Users have to figure out the workaround by themselves.

Logs

Verified on v0.0.68 (Phase 5 scrub addendum, 10.6.76.40). Semicolon
workaround verified working in same session:

  $ nemoclaw bug29test exec -- bash -lc "echo line1; echo line2"
  line1
  line2

Not captured beyond the terminal output above.

NVB#6390354

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: cliCommand line interface, flags, terminal UX, or outputarea: observabilityLogging, metrics, tracing, diagnostics, or debug output

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions