0

I need to put a file content in tabular format and send it in a report in mail via shell script The file already contains information in tabular format, like below Can anyone assist

cat tbs_cust.log

Stat Type Tablespace (GB) Total


ONL P BL9_RATED_EVENT_D 1,295 1,259
ONL P BL9_RATED_EVENT_IX 840 840
ONL P HUGE_D 1,640 677
ONL P HUGE_IX 720 556
ONL P LARGE_D 1,430 136
ONL P LARGE_IX 479 50
ONL P MEDIUM_D 840 510
ONL P MEDIUM_IX 340 221
ONL P POOL_DATA 1,574 572
ONL P SMALL_D 810 139
ONL P SMALL_IX 456 47
ONL P SYSAUX 15 7
ONL P SYSTEM 10 4
ONL U UNDOTBS 210 175
ONL P USERS 0 0
ONL T TEMP 420 420
---------------- sum 5,612

1 Answers1

0

first point:

put a file content in tabular format

awk '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"}' tbs_cust.log > tempTbsCust

Then you can delete the new file by moving it in the old one (if you don't needed it) mv tempTbsCust tbs_cust.log

report in mail via shell script

you can easly use the mail command to send a mail.

you can check Shell script to send email for more details

Regards

C

Community
  • 1
  • 1
ClaudioM
  • 1,418
  • 2
  • 16
  • 42