The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-13-2008
jim mcnamara jim mcnamara is online now
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,464
one way:
Code:
id >> logfile
c code
Code:
/* myid.c */
#include <unistd.h>
uid_t myuid(void)
{
    return getuid();
}

int main()
{
     printf("%d\n", myuid() );
     return 0;
}
cc myid.c -o myid

in your script
Code:
myid >> logfile
Reply With Quote