Question : Cannot capture date-time in a Unix ksh script

I am trying to capture the date/time in a Unix script to then insert as a date field into an Oracle table.

This has worked for me: dateparm=`date "+%d-%b-%Y-%T"`
- I use this to append dateparm to a logfile name

But this is not working for me: time_end =`date "+%x %X"`
- This comes up blank in the record inserted in Oracle and when I echo it in the log file, in the log file it looks like this: time_end =

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
# get the start time per source but only for the first time
      if [ ${TBLNAME} = "PRODT_NM" ]
      then
          time_start=`date "+%x %X"`
      fi
 
. . . 
#get time end per source
      time_end =`date "+%x %X"`
 
      echo "time_end = ${time_end}" >> /tmp/prd_srcelog$$
 
. . . . 
insert into ods.proc_slog values ('172','$time_end', sysdate+5, sysdate+6,0,'OKAY','200904',sysdate+7,'bpeck','test')
Open in New Window Select All

Answer : Cannot capture date-time in a Unix ksh script

try it without the space between  time_end and =
Random Solutions  
 
programming4us programming4us