I am very new to shell scripting. I have a text file which is the output of another utility. This text file has a list of SAF files which is basically a list of orphan attachments in the attachments directory. Now I want to read each file name from the file, get its size and repeat this to all files to get the total size of all the files listed together. This will help us know the amount of space these currently occupying. Any help would be highly appreciated.
S_XL_VIEW_MAP_04-BWNTG_04-1JFF.SAF CURRENT
S_XL_VIEW_MAP_04-BWNTI_04-1JFG.SAF CURRENT
S_DOC_PPSL_0-7VC8N_0-2AQ.SAF CURRENT
S_DOC_PPSL_0-8WGZ_0-DK.SAF ORPHAN
S_DOC_PPSL_0-A41Q_0-FI.SAF ORPHAN
The values CURRENT, ORPHAN represent the status of the files in the attachments directory.I want to add the size of all the files.
Mate I have got what you need as i've been working with backup size issues recently so I assume that you want to calculate size of some spesific files (i give 3 example of file u change them according to extension of your files) and besides lets say u want to consider the modification date of files ( for ex:files that are created earlier than 3 days):