Warum achtet Interix mkdir -p nicht?

446
WilliamKF

Ich verwende Interix unter Windows für Unix-Kompatibilität und finde das -pArgument, dass ich mich mkdirnicht so verhalte, wie ich es erwartet habe:

> which mkdir C:\SFU\bin\mkdir  > mkdir -p c:\Program Files\ A subdirectory or file -p already exists. Error occurred while processing: -p. 

Die SUA-Manpage für mkdir lautet zum Teil:

NAME mkdir - make directories  SYNOPSIS mkdir [-p] [-m mode] directory_name [...]  DESCRIPTION The mkdir utility creates the directories named as operands, in the order specified, using mode rwxrwxrwx (0777) as modified by the current umask(2).  -p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already exist. Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permission for the owner. Do not consider it an error if the argument directory already exists. 

Warum erhalte ich eine Fehlermeldung über das vorhandene Verzeichnis, obwohl ich bestanden habe -p? Es scheint, dass das -pnicht als Flag erkannt wird und stattdessen ein Verzeichnis mit dem Namen erstellt -p. Wie geben Sie das -pArgument weiter?

1

1 Antwort auf die Frage

0
WilliamKF

Das Fenster mkdirwurde anstelle des Interix- Fensters abgeholt. Ich vermeide das Problem, indem ich den mkdirStandort von Interix vollständig verweise . Dies war notwendig, obwohl which mkdirder Interix einen gab.

Vielleicht müssten Sie Ihre PATH-Variable korrigieren? Lie Ryan vor 11 Jahren 0
@Lie Ryan Aber wenn es Pfad war, warum zeigte dann "welcher mkdir" den, den ich will? WilliamKF vor 11 Jahren 0