Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

I want query output to send on mail using table tag and output should be in table

$
0
0
Code:

#! /bin/ksh

#[[ -f ./.profile ]] && . ./.profile 2>/dev/null

if test -f '.profile'; then . ./.profile; fi;

#. .profile

LOG_DIR=/app/rpx/jobs/scripts/just/logs
  sendEmail()
    {
        pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7"
        (
          echo "From: $pzFrom\nTo: $pzTo\nSubject: $pzTitle${pzReplyTo:+\nReply-To: $pzReplyTo}"

              [[ -n "$pzCType" ]] && echo "Content-Type: $pzCType"

              echo
              echo "$pzMsg"
                  [[ -n "$pzFiles" ]] &&
                  echo &&
                  for pzFile in $pzFiles
                  do
                    [[ -f "$pzFile" ]] && uuencode "$pzFile" "$pzFile"
                  done

                ) | mail "$pzTo"
          }

## all pending subscriber .

pending=`sqlplus -s pag_app/abcdef@prpx1-vip.unix.gsm1900.org:7779/prpx.unix.gsm1900.org <<EOF
set feedback off;
set heading off;
set trimspool on;
set pagesize 0;
SET LINESIZE 180;

select msisdn , status_changed_time, rate_plan_id,  status from subscriber where status = 'P' and status_changed_time < sysdate or
der by 2 desc;
EOF`

activating=`sqlplus -s pag_app/abcdef@prpx1-vip.unix.gsm1900.org:7779/prpx.unix.gsm1900.org <<EOF
set feedback off;
set heading off;
set trimspool on;
set pagesize 0;
SET LINESIZE 180;

select msisdn , status_changed_time, rate_plan_id,  status from subscriber where status = 'I' and status_changed_time < sysdate or
der by 2 desc;
EOF`

final="Pending
$pending

Activating
$activating"

sendEmail '' "Pending_Activating" "$final" 'xyz@gmail.com' 'abc@gmail.com' " " ' '

echo $final > $LOG_DIR/pending_`date +%d%m%y`.log

Above output is as below
Code:

Pending
16612969688 11-FEB-15              707 P
16309354405 09-FEB-15              152 P
14049529349 08-FEB-15              183 P
16462516471 03-FEB-15              179 P

Activating
12485580879 10-FEB-15              156 I
16097271993 09-FEB-15              156 I
15202489178 07-FEB-15              183 I
15057305084 07-FEB-15              183 I
13615489396 07-FEB-15              183 I
17022926929 05-FEB-15              183 I
13602235799 05-FEB-15              183 I
15713314401 05-FEB-15              183 I
16236285136 04-FEB-15              156 I
19103369407 02-FEB-15              156 I
19544713197 31-JAN-15              156 I
18326291677 09-JAN-15              174 I
15302079579 29-DEC-14              173 I

but i want it should in table where tables border should be visible

Please help in this regard

Viewing all articles
Browse latest Browse all 16232

Trending Articles