You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] cmd >> out 2>> out loses the command's stdout (echo o >> out 2>> out leaves out empty) #373
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.
Activity