Skip to content

bug: wc output padding differs from real bash for all stdin inputs #322

@chaliy

Description

@chaliy

Summary

All 20+ tests in `wc.test.sh` are marked with `### bash_diff: Bashkit wc uses fixed-width padding for stdin, real bash uses no padding`. While functionally correct, scripts that parse `wc` output with exact string matching will fail.

Example

Real bash:
```
3 file.txt
```

Bashkit:
```
3 file.txt
```

Impact

Any script doing exact string comparison on `wc` output (e.g., `[ "$(wc -l < file)" = "3" ]`) may break due to leading whitespace. This is a common pattern in real-world scripts.

Notes

This might be intentional for consistency, but the large number of bash_diff markers suggests it's worth aligning with real bash behavior, at least for stdin inputs.

Acceptance criteria

  • Evaluate whether to match real bash padding behavior
  • If fixing: update wc output formatting for stdin
  • Remove `### bash_diff` markers from wc.test.sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions