Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am creating a script in which I have to
note down the size of the files which are in
different directory.
Suppose:-
In log dir :
A1.txt
A2.txt
A3.txt
A4.txtand in dat directory"
A4.txt
A5.txt
A6.txt
A2.txt
A1.txt
A3.txtI want to create a script which can give me
the file size of those files which have the
same name in both the folders.For this I have create a for loop.
First for loop do the ls and then
there is a second internal for loop which
runs under the first for loop which checks
whether the file which is in the log directory exists in the dat directory,
if it matches, it stores the result in the
result.txt file having the file size of
both the files.The problem I am having with for loop is
its skipping some files while iterating
through the list of the files.Please post an example so that I have
some idea what I am missing.Thanks.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |