
¿Cómo se antepone una cadena a cada línea de un archivo en MS-DOS?
Y sin comandos de terceros, por lo que nada como AWK (que, según tengo entendido, algunos ejecutan en MSDOS)
Sé que CMD (la consola cmd en sistemas operativos basados en WinNT como NT4 en adelante, por ejemplo, XP o Win10), tiene muchas opciones en el comando for, https://www.robvanderwoude.com/ntfor.php pero MS-DOS no tiene el elegante comando FOR que tiene CMD
verhttps://web.archive.org/web/20100325172740/http://vfrazee.com/ms-dos/6.22/help/ y https://web.archive.org/web/20100521101405/http://www.vfrazee.com/ms-dos/6.22/help/for.htm
Entonces, ¿cómo lo harías en MS-DOS?
Y sin QBASIC
Respuesta1
Un método llamado "Rebotar en el símbolo del sistema".
Un método innovador que los autores de MS-DOS no habrían imaginado.
Funciona también en CMD
Se mencionó en la época de Usenet y los grupos de noticias.
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>