<?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: Shell Script - Sending commands after &amp;quot;su - ergonom&amp;quot; in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582696#M92062</link>
    <description>As mentioned by everyone, you need to use: -c command&lt;BR /&gt;This is in the fine print of su(1):&lt;BR /&gt;The arguments are passed along to the new shell for execution, ...&lt;BR /&gt;&lt;BR /&gt;You then have to read the shell documentation to find out what is valid.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Tony: If you are still worried about the users .profile you could use something like the following: su - ergonom -c `. .profile;$COMMAND`&lt;BR /&gt;&lt;BR /&gt;You don't need to worry about .profile since you are using "su -".  And you should be using (") not (`).</description>
    <pubDate>Fri, 05 Oct 2007 11:20:35 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-10-05T11:20:35Z</dc:date>
    <item>
      <title>Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582689#M92055</link>
      <description>I have a doubt how to implement this:&lt;BR /&gt;&lt;BR /&gt;Like the root user I?d like to run a command after do the following&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;su - ergonom  # Ergonom is a user name&lt;BR /&gt;EdnStart         # I?d like to run this command after do a                           su - ergonom&lt;BR /&gt;&lt;BR /&gt;I cannot change the .profile. How can I send any kind of command after do a su - username ?&lt;BR /&gt;When I run my simple script the prompt change from the root user ( # ) to the user one ( $ergonom ).&lt;BR /&gt;The command EdnStart only runs with the user ergonom and in his home path. This command is a binary file so I don?t have access.&lt;BR /&gt;Somebody can help ?&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Sep 2001 22:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582689#M92055</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2001-09-20T22:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582690#M92056</link>
      <description>You would do this by using the following command:&lt;BR /&gt;&lt;BR /&gt;su - $USER -c $COMMAND&lt;BR /&gt;&lt;BR /&gt;where $USER is the login you want to run $COMMAND under.&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Thu, 20 Sep 2001 22:21:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582690#M92056</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-09-20T22:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582691#M92057</link>
      <description>Hi Ricardo,&lt;BR /&gt;&lt;BR /&gt;Use this command&lt;BR /&gt;su - ergonom -c "type the full command here with the path to that command and any options/switches"&lt;BR /&gt;&lt;BR /&gt;This should work.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Sep 2001 00:22:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582691#M92057</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2001-09-21T00:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582692#M92058</link>
      <description>in order to execute command and its arguments using a temporary environment and permissions of user, you should do the following:&lt;BR /&gt;&lt;BR /&gt;su - user -c "command "&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;federico</description>
      <pubDate>Fri, 21 Sep 2001 05:20:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582692#M92058</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-09-21T05:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582693#M92059</link>
      <description>The syntax mentioned will definitely do the job. If you are still worried about the users .profile you could use something like the following:&lt;BR /&gt;&lt;BR /&gt;su - ergonom -c `. .profile;$COMMAND`&lt;BR /&gt;&lt;BR /&gt;Rgds, Tony</description>
      <pubDate>Fri, 21 Sep 2001 08:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582693#M92059</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2001-09-21T08:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582694#M92060</link>
      <description>&lt;BR /&gt;Hi&lt;BR /&gt;&lt;BR /&gt;If you can install (you need root access !!!) &lt;BR /&gt;sudo, you can configure your system to launch&lt;BR /&gt;commands as another user. For example, you can&lt;BR /&gt;configure sudo to launch "ls" as "user2" when&lt;BR /&gt;you are "user1".&lt;BR /&gt;&lt;BR /&gt;You can find sudo at :&lt;BR /&gt;&lt;A href="http://hpux.cict.fr/hppd/hpux/Sysadmin/sudo-1.6.2b1/" target="_blank"&gt;http://hpux.cict.fr/hppd/hpux/Sysadmin/sudo-1.6.2b1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Sep 2001 08:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582694#M92060</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-09-21T08:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582695#M92061</link>
      <description>I have run scripts this way successfully. One caveat is the stdout seems to get lost.</description>
      <pubDate>Wed, 03 Oct 2007 17:35:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582695#M92061</guid>
      <dc:creator>System Administrator_3</dc:creator>
      <dc:date>2007-10-03T17:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script - Sending commands after "su - ergonom"</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582696#M92062</link>
      <description>As mentioned by everyone, you need to use: -c command&lt;BR /&gt;This is in the fine print of su(1):&lt;BR /&gt;The arguments are passed along to the new shell for execution, ...&lt;BR /&gt;&lt;BR /&gt;You then have to read the shell documentation to find out what is valid.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Tony: If you are still worried about the users .profile you could use something like the following: su - ergonom -c `. .profile;$COMMAND`&lt;BR /&gt;&lt;BR /&gt;You don't need to worry about .profile since you are using "su -".  And you should be using (") not (`).</description>
      <pubDate>Fri, 05 Oct 2007 11:20:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-sending-commands-after-quot-su-ergonom-quot/m-p/2582696#M92062</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-05T11:20:35Z</dc:date>
    </item>
  </channel>
</rss>

