
Wie stellt man in MS-DOS jeder Zeile einer Datei eine Zeichenfolge voran?
Und ohne Befehle von Drittanbietern, also nichts wie AWK (das, soweit ich weiß, einige unter MS-DOS laufen haben)
Ich weiß, dass CMD (die cmd-Konsole in WinNT-basierten Betriebssystemen wie NT4 und höher, z. B. XP oder Win10) viele Optionen für den Befehl hat. https://www.robvanderwoude.com/ntfor.php aber MS-DOS hat nicht den schicken FOR-Befehl, den CMD hat
sehenhttps://web.archive.org/web/20100325172740/http://vfrazee.com/ms-dos/6.22/help/ Und https://web.archive.org/web/20100521101405/http://www.vfrazee.com/ms-dos/6.22/help/for.htm
Wie würden Sie es also in MS-DOS machen?
Und ohne QBASIC
Antwort1
Eine Methode namens „Abprallen von der Eingabeaufforderung“.
Eine innovative Methode, die sich die Autoren von MS-DOS nicht hätten vorstellen können.
Es funktioniert auch in CMD
Es wurde in den Tagen von Usenet und Newsgroups erwähnt.
C:\rara>dir /b
file.txt
C:\rara>type file.txt
house
fish
dog
C:\rara>ren file.txt file.bat
C:\rara>prompt the
thefile >file2
'house' is not recognized as an internal or external command,
operable program or batch file.
'fish' is not recognized as an internal or external command,
operable program or batch file.
'dog' is not recognized as an internal or external command,
operable program or batch file.
theprompt $p$g
C:\rara>type file2
thehouse
thefish
thedog
C:\rara>