Walter said:
db.bat takes the same arguments as dir.
I want to look simultaneously at all the time information related to a
set of files. e.g. given C:\wfb\bin) for %t in (c a w) do db/t%t db.bat*
C:\wfb\bin) db/tc db.bat*
2003/06/06 17:55 1,304 C:\wfb\bin\db.bat
2003/06/06 13:57 486 C:\wfb\bin\db.bat.0
C:\wfb\bin) db/ta db.bat*
2003/09/02 00:00 1,304 C:\wfb\bin\db.bat
2003/06/06 00:00 486 C:\wfb\bin\db.bat.0
C:\wfb\bin) db/tw db.bat*
2003/06/23 08:54 1,304 C:\wfb\bin\db.bat
2003/06/06 13:50 486 C:\wfb\bin\db.bat.0
C:\wfb\bin)
I want to be able to produce
2003/06/06 17:55 1,304 C:\wfb\bin\db.bat
2003/09/02 00:00 1,304 C:\wfb\bin\db.bat
2003/06/23 08:54 1,304 C:\wfb\bin\db.bat
2003/06/06 13:57 486 C:\wfb\bin\db.bat.0
2003/06/06 00:00 486 C:\wfb\bin\db.bat.0
2003/06/06 13:50 486 C:\wfb\bin\db.bat.0
so I can use sed to filter corresponding lines to produce
2003/06/06 17:55 2003/09/02 00:00 2003/06/23 08:54 1,304 C:\wfb\bin\db.bat
2003/06/06 13:57 2003/06/06 00:00 2003/06/06 13:50 486 C:\wfb\bin\db.bat.0
I could tag the outputs of the 3 db commands, sort the tagged files and
remove the tags. That is all very tedious. I am hoping to find a method
using cmd.exe alone.
Maybe something like the following. . . .
- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
C:\cmd>dirdates test\*mvs*.cmd
Created Last Accessed Last Written Filename
----------------- ----------------- ----------------- ------------------------------------
02/27/2003 03:51p 03/07/2003 05:06p 02/27/2003 03:51p "C:\cmd\TEST\BackupMVSDatasets.cmd"
04/22/2002 01:51p 12/20/2002 03:16p 04/22/2002 01:51p "C:\cmd\TEST\compareMVSDirs.cmd"
01/15/2002 01:04p 12/20/2002 03:16p 08/20/2000 01:06a "C:\cmd\TEST\COPYMVS.CMD"
02/19/2003 03:42p 03/05/2003 11:10a 02/26/2003 04:37p "C:\cmd\TEST\FetchMVSJobFile.cmd"
01/15/2002 01:04p 12/20/2002 03:17p 10/22/2001 12:48a "C:\cmd\TEST\GetMVSDirs.cmd"
01/15/2002 01:04p 12/20/2002 03:17p 09/06/2001 05:07p "C:\cmd\TEST\mvscopy.cmd"
01/15/2002 01:03p 12/20/2002 03:17p 01/14/2002 04:51p "C:\cmd\TEST\MVSEMAIL.CMD"
01/15/2002 01:04p 03/14/2003 10:42a 08/06/2002 01:58p "C:\cmd\TEST\MVSFETCH.CMD"
01/15/2002 01:04p 02/25/2003 04:36p 09/12/2001 01:02a "C:\cmd\TEST\MVSLOC.CMD"
01/15/2002 01:04p 12/20/2002 03:17p 11/08/2001 10:45a "C:\cmd\TEST\mvsmcopy.cmd"
01/15/2002 01:04p 12/20/2002 03:17p 07/25/2002 03:10p "C:\cmd\TEST\mvsmdel.cmd"
01/15/2002 01:04p 12/20/2002 03:17p 08/08/2001 05:41p "C:\cmd\TEST\nsmvsfile.cmd"
01/15/2002 01:03p 12/20/2002 03:17p 01/14/2002 04:51p "C:\cmd\TEST\parseMVSUNIXdir.cmd"
01/15/2002 01:04p 12/20/2002 03:17p 02/02/2001 05:57p "C:\cmd\TEST\readmvsdump.cmd"
06/14/2002 03:58p 09/02/2003 09:35a 08/21/2002 10:15a "C:\cmd\TEST\UCBMVSinfo.cmd"
C:\cmd>rlist util\dirdates.cmd
=====begin C:\cmd\util\dirdates.cmd ====================
01. @echo off
02. ::
03. :: shows the created, accessed, and written dates for
04. :: the specified file(s) (parameter %%1)
05. ::
06. if {%1} NEQ {} if {%1} NEQ {?} if {%1} NEQ {/?}^
07. if /i {%1} NEQ {HELP} goto :begin
08. call XHELP %~f0
09. goto :EOF
10.
11. :begin
12. if not exist %1 echo File %1 not found....&goto :EOF
13. setlocal
14. set filespec=%1
15. set filepath=%~dp1
16. echo.
17. echo Created Last Accessed Last Written Filename
18. echo ----------------- ----------------- ----------------- ------------------------------------
19. for /f "tokens=*" %%a in (
20. 'dir /b /a-d %filespec%'
21. ) do call :dates "%%a"
22. endlocal&goto :EOF
23. :dates
24. set thisfile=%1
25. set thisfile=%thisfile:&=^&%
26. set nameonly=%thisfile:"=%
27. set file="%filepath%%nameonly%"
28. for %%f in (c a w) do (
29. for /f "tokens=1,2" %%a in (
30. 'dir /t%%f %file%
31. ^| find "/"'
32. ) do set %%f_date=%%a %%b
33. )
34. echo %c_date% %a_date% %w_date% %file%
35. goto :EOF
=====end C:\cmd\util\dirdates.cmd ====================
C:\cmd>currver xhelp qblist
===== begin file c:\cmd\TEST\XHELP.CMD =====
01. @echo off
02. ::
03. :: Displays the contents of the 'flowerbox' in a CMD or BAT
04. :: file.
05. ::
06. :: '%~n0' will be displayed as the name of the referenced file
07. ::
08.
09. if {%1} NEQ {} if {%1} NEQ {?} if {%1} NEQ {/?} if /i {%1} NEQ {HELP} goto :begin
10. call XHELP %~f0
11. goto :EOF
12.
13. :begin
14. setlocal
15. set cd=
16. set whichfile=%1
17. for /f "tokens=*" %%a in (
18. 'dir %whichfile% ^| find "/"'
19. ) do set direntry=%%a
20. set fname=%~n1
21. echo :
22. echo : %direntry:~0,38% %whichfile%
23. echo :
24. for /f "tokens=* delims=" %%* in (
25. 'findstr /b /c:"::" %whichfile%') do call :display %%*
26. endlocal& goto :EOF
27. :display
28. set line=%*
29. set line=%line:~1%
30. if not defined cd set line=%line:~1%
31. call set line=%%line:^%~n0=%fname%%%
32. echo %line%
33. goto :EOF
34. :EOF
35.
===== end file c:\cmd\TEST\XHELP.CMD =====
- - - - - - - - - - end screen capture Win2000 - - - - - - - - - -