The output of my shell script is as follows(please find the attached image)
workflow_Name1
Succeeded
Tue May 19 11:15:33 2015
workflow_Name2
Succeeded
Wed Jun 10 18:00:21 2015
I want this to be changed to
workflow_Name1 :-Succeeded :-Tue May 19 11:15:33 2015
workflow_Name2 :-Succeeded :-Wed Jun 10 18:00:21 2015
Following is the script I am using. Could you please let me know how to achieve this.
#!/bin/bash
# source $HOME/.bash_profile
output=/home/infaprd/cron/output.lst
sqlplus -s user/test@dev <<EOF >$output # Capture output from SQL
set linesize 55 pages 500
spool output_temp.lst;
set head off;
select sysdate from dual;
set head on;
spool off;
EOF
for name in workflow_Name1 workflow_Name2; do
pmcmd getworkflowdetails -Repository ${name}
done |
grep -e "Workflow:" -e "Workflow run status:" -e "End time:" | cut -d'[' -f2 | cut -d']' -f1 |
sed -e 's/ *$//' >> $output
mail -s "Output - `date '+%d-%m-%y'`" [email protected] <$output