Tuesday, 10 September 2013

Condense multiple files to a single BASH script

Condense multiple files to a single BASH script

I have a .body, .script, and .sql that I would like to condense in to a
single script but I am not sure how to go about it.
.body contains the e-mail message.
.sql spools the data to a .csv:
The .script runs the .sql, and sends an e-mail with the attached Report.zip:
sqlplus $user/$pass@$db @script.sql
(cat script.body; uuencode Report.zip Report.zip) | mail -s "Report"
user@domain.com -- -f no-reply@domain.com
Is it possible that this (including the SQL) can all be done in a single
BASH script?

No comments:

Post a Comment