Posts: 126
Name: Clayton Beaudin
Location: Proud to be Canadian
|
Not sure if this is possible, but ill ask anyways.
I have a script with a variable "$totalfiles" and it contains the number of files in a specified directory (ie. if /root/folder1 contains 10 files, $totalfiles==10)
When i have been adding and deleting files from these dir's i have been manually changing the variable in the script accordingly.
Im looking for a script to count the number of files in a directory and automatically set $totalfiles to the correct number so that other people can add and delete files without having to change the script.
The script does not connect to a database.
It would be very appreciated if you could explain any code given so i can understand how it works and learn from it in the future. I understand your all busy so if you dont have time to explain any code i understand, im sure i can figure it out after some googling
Thanks in advance for all replies, it is greatly appreciated.
|