Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

PowerShell wrapper breaks some common GNU command forms

Aperta
#23 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
powershell, rust

Direzione di ricerca

Inizia riproducendo i casi cat -- -dash.txt, grep e cp con il codice sorgente del wrapper PowerShell al commit fe33724, quindi confronta la sua gestione degli argomenti con l’artefatto della release. Verifica se il wrapper può preservare il caso del nome file -- e identifica quali altre forme GNU/POSIX sono limitazioni della sintassi della shell; il lavoro deve includere un fix verificato o una documentazione esplicita del wrapper.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-bug P-backlog

With the PowerShell wrapper enabled, I still hit a few GNU command lines that behave in surprising ways.

The clearest one is a filename starting with -:

Set-Content -LiteralPath '-dash.txt' -Value 'dash file foo'
cat -- -dash.txt

Expected:

dash file foo

Actual:

cat.cmd: '-dash': The system cannot find the file specified.
cat: .txt: The system cannot find the file specified.

It looks like -dash.txt is getting split into -dash and .txt. The same shape also fails for me with:

grep foo -- -dash.txt
cp -- -dash.txt dash-copy.txt

This workaround does work:

cat -- .\-dash.txt
grep foo -- .\-dash.txt
cp -- .\-dash.txt dash-copy.txt

I also ran into a few common GNU/POSIX forms that do not survive the wrapper:

find . \( -name "*.txt" -o -name "*.log" \) -print
find . -name "*.txt" -exec grep foo {} \;
[ -f a.txt ]
cat space\ name.txt
ls \[ab\].txt

Some of these are clearly PowerShell-vs-POSIX-shell syntax issues, so I am not claiming they are all coreutils bugs. But they are common command lines from GNU docs / muscle memory, and they are exactly the kind of cases users will try when using this project.

It would be useful either to handle the cases that can be handled, or to document the boundary of the PowerShell wrapper more explicitly. The -- -dash.txt case in particular looks like an argument-passing bug rather than just a POSIX shell compatibility limitation.

Environment:

  • Windows 10.0.26200
  • PowerShell 7.5.5
  • Wrapper source tested from commit fe33724
  • Release artifact tested: coreutils-2026.5.29-x64.exe
  • SHA256: 23B019D0664F1F5AA2A0C503435F8B52D3C8EEA2AEC1C0609CE21FCE18667281
Lingua principale
Rust
Stelle
5.2k
Fork
109
Merge medio
1g 16h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/coreutils

Tutte le issue di microsoft/coreutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.