<?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: su command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872020#M98690</link>
    <description>with su you can only call external scripts with the -c option.&lt;BR /&gt;and those functions you are calling why dont you put them in the script which you are calling by -c option.&lt;BR /&gt;&lt;BR /&gt;Rajeev</description>
    <pubDate>Tue, 31 Dec 2002 01:21:50 GMT</pubDate>
    <dc:creator>Rajeev  Shukla</dc:creator>
    <dc:date>2002-12-31T01:21:50Z</dc:date>
    <item>
      <title>su command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872018#M98688</link>
      <description>Can the "su" command be used to call a function within the script instead of calling a script/binary outside the script?&lt;BR /&gt;&lt;BR /&gt;Example :&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh &lt;BR /&gt; ---&lt;BR /&gt; --&lt;BR /&gt;su - user1 -c &lt;FUNCTIONNAME&gt;  &lt;BR /&gt;su - user2 -c &lt;FUNCTIONNAME&gt;&lt;BR /&gt;su - user3 -c &lt;FUNCTIONNAME&gt;&lt;BR /&gt;&lt;BR /&gt;functionname()&lt;BR /&gt;{&lt;BR /&gt;---&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;I tried it with single/double/back quotes but "su" doesnt like it.  Is it known to work or the only way is to call a separate script ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;-Krishnan&lt;/FUNCTIONNAME&gt;&lt;/FUNCTIONNAME&gt;&lt;/FUNCTIONNAME&gt;</description>
      <pubDate>Tue, 31 Dec 2002 00:39:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872018#M98688</guid>
      <dc:creator>Krishnan Viswanathan</dc:creator>
      <dc:date>2002-12-31T00:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: su command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872019#M98689</link>
      <description>H Krishnan,&lt;BR /&gt;&lt;BR /&gt;-c expects a command|script outside of the current script. So, a function within the same script cannot be passed onto it.&lt;BR /&gt;&lt;BR /&gt;I would do the following in this scenario.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; EOF &amp;gt;&amp;gt; /tmp/script$$&lt;BR /&gt;your commands..&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;chmod 755 /tmp/script$$ &lt;BR /&gt;&lt;BR /&gt;su - user1 -c /tmp/script$$&lt;BR /&gt;su - user2 -c /tmp/script$$&lt;BR /&gt;&lt;BR /&gt;rm /tmp/script$$&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 31 Dec 2002 00:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872019#M98689</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2002-12-31T00:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: su command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872020#M98690</link>
      <description>with su you can only call external scripts with the -c option.&lt;BR /&gt;and those functions you are calling why dont you put them in the script which you are calling by -c option.&lt;BR /&gt;&lt;BR /&gt;Rajeev</description>
      <pubDate>Tue, 31 Dec 2002 01:21:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-command/m-p/2872020#M98690</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-31T01:21:50Z</dc:date>
    </item>
  </channel>
</rss>

