How to call a C program in a shell... [message #196129] |
Wed, 04 October 2006 04:38 |
oracledba_raja
Messages: 23 Registered: July 2006
|
Junior Member |
|
|
Hi All,
Good Morning.
In one of our development server, there is a shell program, which in turn calls a 'c' program.
The c program is compiled and is in executable form.
But it is found that it's not all using the C program
and it skips that program (or unrecognised it?)
here the coding is:
#!/bin/ksh
log_file=/prod/bin/AAA.log
history_file=/prod/history/history.txt
date_stamp=`date "+ %d%m%Y"`
echo "Processing Begin: $date_stamp" >> $log_file
if [ -s "/prod/tmp/AAAA.data" ]
then
echo "Input file found"
if [ ! -s "$history_file" ]
then
echo "STATUS" > $history_file
echo "PROCESSING DATE" >> $history_file
fi
# the follwing "processnew1" is the C program
processnew1
echo "Successfully Completed" >> $log_file
else
echo "Processing: No Input file is there." >> $log_file
fi
echo "Processing End: $date_stamp" >> $log_file
~
The output logfile contains
" Processing Begin: 04102006
Processing: No Input file is there.
Processing End: 04102006 "
===============
File permission
The source program
-rw-r--r-- 1 lms lmsgrp 1826 Oct 4 15:52 processnew1.cc
After compilation with execute permission
-rwxr-xr-x 1 lms lmsgrp 8688 Oct 4 15:56 processnew1
---
Could you please guide me...
Thanks a lot.
Regards,
Raja
|
|
|
|
|