Skip to content

[BUG] cmd >> out 2>> out loses the command's stdout (echo o >> out 2>> out leaves out empty) #373

Open

Description

@strandly-the-agent

Checks

  • I have updated to the latest minor and patch version of Strands Shell (built from main @ dbb6189)
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Binding

Rust

Strands Shell Version

dbb6189 (--version prints 0.0.0)

Language Runtime Version

Rust 1.100.0

Operating System

Linux 6.18 (aarch64)

Installation Method

built from source

Steps to Reproduce

Each line is a separate strands-shell -c '...' run in an empty directory.

echo o >> out 2>> out; cat out
f(){ echo o; echo e >&2; }; f >> out 2>> out; cat out
f(){ echo o; echo e >&2; }; f > out 2>> out; cat out

Expected Behavior

Same as bash 5.2.15: the first prints o; the second and third print o then e.

Actual Behavior

The first prints nothing: out is empty and the status is 0. The second and third print only e. Whatever the command wrote to stdout is lost with no error.

Existing content survives (echo keep > out; echo o >> out 2>> out leaves keep), and these work as in bash: f >> out 2>&1, and f >> out 2>> err with two different files.

Additional Context

Found while reviewing #354; not related to that change. cmd >> log 2>> log is a common way to append both streams to one log file.

Possible Solution

Not investigated.

Related Issues

n/a

Activity

  1. added
    bug
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Fields

    Language

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions