Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DOS utility to display 1st line of all files in directory? (Users)

posted by Rugxulo Homepage, Usono, 18.12.2012, 20:38

> So, how seamless do you think the transition from MS-DOS 6.21 to 4DOS would
> be for me?

It's probably not worth it, then. 4DOS is only a COMMAND.COM replacement, a shell, "mostly" compatible (and adds a billion features for powerful scripting). You don't need it, but a lot of people prefer it for various reasons.

Anyways, here's a quick .BAT / .BAS combo I whipped up that should work verbatim in MS-DOS 6. (I assume this does what you want, otherwise you might have to use Sed, Awk, Edlin, or similar utility from wherever):


@echo off
REM Usage:  for %a in (*.txt) do call oneline.bat %a
set B1=%TEMP%.\oneline.bas
echo OPEN ENVIRON$("MYFILE") FOR INPUT AS #1 >%B1%
echo INPUT #1, line$ : PRINT line$ >>%B1%
echo CLOSE >>%B1%
echo SYSTEM >>%B1%
:begin
set MYFILE=%1
qbasic /run oneline.bas
for %%z in (MYFILE B1) do set %%z=

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum