<?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 Re: Command run under 'su' doesn't work right in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143755#M156019</link>
    <description>If I put it on separate lines, it just comes back to the prompt and then stops.  The script halts, essentially...</description>
    <pubDate>Fri, 12 Dec 2003 15:55:03 GMT</pubDate>
    <dc:creator>Jayson Hurd_2</dc:creator>
    <dc:date>2003-12-12T15:55:03Z</dc:date>
    <item>
      <title>Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143749#M156013</link>
      <description>I have a command that I run in UNIX as a user called "cognos":&lt;BR /&gt;&lt;BR /&gt;$ /jv77/cognos/cer3/bin/configcp -t /jv77/cognos/cer3/bin/start.ccp&lt;BR /&gt;&lt;BR /&gt;It runs as it should.&lt;BR /&gt;&lt;BR /&gt;When I run it this way logged in as root:&lt;BR /&gt;&lt;BR /&gt;su -cognos -c "/jv77/cognos/cer3/bin/configcp -t /jv77/cognos/cer3/bin/start.ccp"&lt;BR /&gt;&lt;BR /&gt;It gives me errors that certain files can't be found.  Does this -c actually invoke the cognos user's profile?  It seems paths aren't being established, or that it's using root's path, etc....</description>
      <pubDate>Fri, 12 Dec 2003 14:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143749#M156013</guid>
      <dc:creator>Jayson Hurd_2</dc:creator>
      <dc:date>2003-12-12T14:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143750#M156014</link>
      <description>HI Jayson,&lt;BR /&gt;&lt;BR /&gt;No, the dash between su &amp;amp; username sources the user's environment.&lt;BR /&gt;But there MUST be spaces on both sides.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 14:53:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143750#M156014</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-12-12T14:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143751#M156015</link>
      <description>Sounds like the env isn't loading....&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;su -cognos&lt;BR /&gt;env&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;su -cognos -c env&lt;BR /&gt;&lt;BR /&gt;Different?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 14:54:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143751#M156015</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2003-12-12T14:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143752#M156016</link>
      <description>Try doing it like this:&lt;BR /&gt;&lt;BR /&gt;su - cognos -i -c "/jv77/cognos/cer3/bin/configcp -t /jv77/cognos/cer3/bin/start.ccp"&lt;BR /&gt;&lt;BR /&gt;That will run the shell in interactive mode. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Fri, 12 Dec 2003 14:59:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143752#M156016</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2003-12-12T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143753#M156017</link>
      <description>Jayson,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;su - cognos -c '/jv77/cognos/cer3/bin/configcp -t /jv77/cognos/cer3/bin/start.ccp'&lt;BR /&gt;&lt;BR /&gt;Note the spacing and 'quote' change.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Fri, 12 Dec 2003 14:59:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143753#M156017</guid>
      <dc:creator>Dwyane Everts_1</dc:creator>
      <dc:date>2003-12-12T14:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143754#M156018</link>
      <description>Jayson -&lt;BR /&gt;This is a very common problem. As others mentioned, most often it involves env variables.&lt;BR /&gt;In out shop we are accustomed to place exports of the required environment variables in the script to be executed.&lt;BR /&gt;Having done this, we seldom encounter any errors.&lt;BR /&gt;Yes, this means acouple of export XXX="YYY" in your script to execute, but it sure relieves some headaches.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Fri, 12 Dec 2003 15:39:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143754#M156018</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-12-12T15:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143755#M156019</link>
      <description>If I put it on separate lines, it just comes back to the prompt and then stops.  The script halts, essentially...</description>
      <pubDate>Fri, 12 Dec 2003 15:55:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143755#M156019</guid>
      <dc:creator>Jayson Hurd_2</dc:creator>
      <dc:date>2003-12-12T15:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Command run under 'su' doesn't work right</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143756#M156020</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;what wonders me is, it should have complained about an invalid option since there is no space after the -. Probably he does interpret this as additional command and tries to run it as root. If you put a command on two lines, you will have to use a continuation character, so the two lines will be interpreted as one and I think it is the \, you will have to use at the end of line one. But still the su - cognos should work. It will read the .profile and execute the command.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Dec 2003 16:09:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-run-under-su-doesn-t-work-right/m-p/3143756#M156020</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-12T16:09:24Z</dc:date>
    </item>
  </channel>
</rss>

