Scripting
Attempting to write 2 scripts:
One script called 'totalimg' extracts the img src from a html file and works out the sizes of the images: Code:
#!/bin/bash Another called 'totalimgs' starts at the current directory and works thru all subdirectories, to calculate each html file's img filesizes: Code:
#!/bin/bash The problem I have is that totslimgs works for the current dir and all its html files, but the subdirs' html files all come up as zero. Would like to know why? So far I have written these and tested them myself... confused why $1 is not allowing totalimg to calculate the size.... Any help greatly appreciated! |
I have not tested, but I suspect that the working directory is not being passed and therefore it isn't finding the .img files
You may want to try using dirname and basename to cut the html filename into it's respective components so that you know what directory to start looking for the .img files. PS: Welcome to LQ ;) |
Scripting
Thank you Disillusionist!
I have tried what you said with acquiring the full pathname: Code:
#!/bin/bash I think it may be a problem with the grep -i ... $1 in totalimg... but I am not sure. And thank you for welcoming me :) |
Try editing totalimg:
Code:
#!/bin/bash |
All times are GMT -5. The time now is 01:26 AM. |