<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic getuid() and C Program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743760#M68360</link>
    <description>I am having great difficulty in writing the following C program,..&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;int curruid;&lt;BR /&gt;char commandline[1024];&lt;BR /&gt;&lt;BR /&gt;curruid=getuid();&lt;BR /&gt;strcat(commandline, "/usr/local/bin/script1.sh ");&lt;BR /&gt;strcat(commandline, curruid);&lt;BR /&gt;&lt;BR /&gt;system(commandline);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This program is designed to get the current uid of the person running the program and pass it to the Shell script for validation. However, C will not permit me to convert the integer value of getuid() to a string to concatenate to the command line. I have tried various combinations and all end up using the number passed as an ASCII value rather than its actual value.&lt;BR /&gt;&lt;BR /&gt;Anyone know of any methods of converting this?&lt;BR /&gt;&lt;BR /&gt;Thanks, Ian Dennison&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Jun 2002 07:27:35 GMT</pubDate>
    <dc:creator>Ian Dennison_1</dc:creator>
    <dc:date>2002-06-13T07:27:35Z</dc:date>
    <item>
      <title>getuid() and C Program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743760#M68360</link>
      <description>I am having great difficulty in writing the following C program,..&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;int curruid;&lt;BR /&gt;char commandline[1024];&lt;BR /&gt;&lt;BR /&gt;curruid=getuid();&lt;BR /&gt;strcat(commandline, "/usr/local/bin/script1.sh ");&lt;BR /&gt;strcat(commandline, curruid);&lt;BR /&gt;&lt;BR /&gt;system(commandline);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This program is designed to get the current uid of the person running the program and pass it to the Shell script for validation. However, C will not permit me to convert the integer value of getuid() to a string to concatenate to the command line. I have tried various combinations and all end up using the number passed as an ASCII value rather than its actual value.&lt;BR /&gt;&lt;BR /&gt;Anyone know of any methods of converting this?&lt;BR /&gt;&lt;BR /&gt;Thanks, Ian Dennison&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 07:27:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743760#M68360</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-06-13T07:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: getuid() and C Program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743761#M68361</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;use:&lt;BR /&gt;   sprintf(string, "%i", curruid);&lt;BR /&gt;&lt;BR /&gt;The string 'string' will contain the current uid.&lt;BR /&gt;&lt;BR /&gt;Bye,&lt;BR /&gt;Rik</description>
      <pubDate>Thu, 13 Jun 2002 07:32:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743761#M68361</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2002-06-13T07:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: getuid() and C Program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743762#M68362</link>
      <description>Thanks Rik, magical answer!</description>
      <pubDate>Thu, 13 Jun 2002 07:42:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getuid-and-c-program/m-p/2743762#M68362</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-06-13T07:42:29Z</dc:date>
    </item>
  </channel>
</rss>

