I have scripted Tail.bat to perform both functions.
The syntax is:
tail FileName \[NumberOfLinesToDisplay\]
If NumberOfLinesToDisplay is 0, you can set the file line count by using:
for /f %%i in ('tail FileName 0') do set lines=%%i
If NumberOfLinesToDisplay is omitted, 10 lines will be displayed.
If NumberOfLinesToDisplay is greater than the lines in the file, all lines in the file will be displayed.
Tail.bat contains:
@echo off if \{%1\}\{\} @echo FileName parameter requied.&goto :EOF if not exist %1 @echo %1 does NOT exist.&goto :EOF setlocal set file=%1 set /a number=10 if not \{%2\}
\{\} set /a number=%2 for /f %%i in ('find /v /c "" ^
0 comments
Hide comments