Calling a C Function from a Bourne Script

From: Sumair Mahmood (Sumair.Mahmood@qlogic.com)
Date: Wed Apr 02 2003 - 15:20:48 EST


Respected Colleagues:

Is it possible to call a C Function from the command line, or,
better yet, from within a Bourne shell script? In looking for
a way to convert from Unix epoch time (i.e., '1048997466')
to human time, I came upon the ctime() function:

   # man ctime
   ...
     The ctime() function converts the time pointed to by clock,
     representing the time in seconds since the Epoch (00:00:00
     UTC, January 1, 1970), to local time in the form of a 26-
     character string as shown below.
   ...

However, I obviously can't run ctime() from the command
line because it's not a physical binary anywhere in my PATH:

   # ctime 1048997466
   ctime: not found

   # which ctime
   no ctime in ...[truncated path]...

I've always wanted to learn C, and while I know this list is not
the venue for that, maybe someone would be kind enough to
shed some light on my query. I personally don't think this is
possible, but a co-worker insisted it was. I promise
to summarize!

Thanks a millio... er, an epoch!

;-)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Sumair Mahmood
 Sr. Unix Systems Engineer
 QLogic Corporation

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:07 EDT