<?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: how to write su in shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717715#M385589</link>
    <description>sudo su - kumar -c "cd /home/kumar/lic &amp;amp;&amp;amp; /path/to/lmstat lic | more"</description>
    <pubDate>Wed, 24 Nov 2010 16:14:14 GMT</pubDate>
    <dc:creator>Earl_Crowder</dc:creator>
    <dc:date>2010-11-24T16:14:14Z</dc:date>
    <item>
      <title>how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717710#M385584</link>
      <description>i want to check license status in another user login .i have su permission in sudo file.&lt;BR /&gt;&lt;BR /&gt;kindly find the step to find the license status&lt;BR /&gt;sudo su - kumar&lt;BR /&gt;cd /home/kumar/lic&lt;BR /&gt;lmstat lic |more&lt;BR /&gt;&lt;BR /&gt;Question&lt;BR /&gt;kindly help how to write this script in my&lt;BR /&gt;login</description>
      <pubDate>Wed, 24 Nov 2010 14:28:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717710#M385584</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-24T14:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717711#M385585</link>
      <description>Simply put all those in a file and give it an execute permission.&lt;BR /&gt;&lt;BR /&gt;vi script&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;sudo su - kumar&lt;BR /&gt;cd /home/kumar/lic&lt;BR /&gt;lmstat lic |more&lt;BR /&gt;:wq!&lt;BR /&gt;&lt;BR /&gt;chmod 755 script&lt;BR /&gt;&lt;BR /&gt;Now run it&lt;BR /&gt;&lt;BR /&gt;./script</description>
      <pubDate>Wed, 24 Nov 2010 14:35:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717711#M385585</guid>
      <dc:creator>Shibin_2</dc:creator>
      <dc:date>2010-11-24T14:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717712#M385586</link>
      <description>after command excuted loged in kumar but license status command not running&lt;BR /&gt;&lt;BR /&gt;find the output&lt;BR /&gt;rajesh &amp;amp;./lic&lt;BR /&gt;(c)Copyright 1983-2000 Hewlett-Packard Co.,  All Rights Reserved.&lt;BR /&gt;(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California&lt;BR /&gt;(c)Copyright 1980, 1984, 1986 Novell, Inc.&lt;BR /&gt;(c)Copyright 1986-1992 Sun Microsystems, Inc.&lt;BR /&gt;(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology&lt;BR /&gt;(c)Copyright 1989-1993  The Open Software Foundation, Inc.&lt;BR /&gt;(c)Copyright 1986 Digital Equipment Corp.&lt;BR /&gt;(c)Copyright 1990 Motorola, Inc.&lt;BR /&gt;(c)Copyright 1990, 1991, 1992 Cornell University&lt;BR /&gt;(c)Copyright 1989-1991 The University of Maryland&lt;BR /&gt;(c)Copyright 1988 Carnegie Mellon University&lt;BR /&gt;(c)Copyright 1991-2000 Mentat Inc.&lt;BR /&gt;(c)Copyright 1996 Morning Star Technologies, Inc.&lt;BR /&gt;&lt;BR /&gt;&amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 15:22:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717712#M385586</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-24T15:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717713#M385587</link>
      <description>Find, where is lmstat command located &lt;BR /&gt;&lt;BR /&gt;you may have to specify the path.&lt;BR /&gt;&lt;BR /&gt;whereis lmstat or find / -name 'lmstat*'&lt;BR /&gt;&lt;BR /&gt;Then add that path to above script and try.</description>
      <pubDate>Wed, 24 Nov 2010 15:33:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717713#M385587</guid>
      <dc:creator>Shibin_2</dc:creator>
      <dc:date>2010-11-24T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717714#M385588</link>
      <description>rajesh &amp;amp;more lic&lt;BR /&gt;sudo su - kumar   -----1st line&lt;BR /&gt;more /home/kumar/lic/lmstat lic |more -----2nd line&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tha above mentioned script after 1st line excuted successfully ,but 2nd line not excuted after the put ctrl+d then it shows you cannot able to access the cd /home/kumar/lic/lmstat  file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;output&lt;BR /&gt;&lt;BR /&gt;rajesh&amp;amp;./lic&lt;BR /&gt;after login session&lt;BR /&gt;&lt;BR /&gt;kumar&amp;amp; (script stuck)&lt;BR /&gt;ctrl+d&lt;BR /&gt;/home/kumar/lic/lmstat :  not found.&lt;BR /&gt;&lt;BR /&gt;rajesh$&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 16:05:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717714#M385588</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-24T16:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717715#M385589</link>
      <description>sudo su - kumar -c "cd /home/kumar/lic &amp;amp;&amp;amp; /path/to/lmstat lic | more"</description>
      <pubDate>Wed, 24 Nov 2010 16:14:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717715#M385589</guid>
      <dc:creator>Earl_Crowder</dc:creator>
      <dc:date>2010-11-24T16:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717716#M385590</link>
      <description>after this command it asking the password:&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 16:17:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717716#M385590</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-24T16:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717717#M385591</link>
      <description>&amp;gt;after this command it asking the password:&lt;BR /&gt;&lt;BR /&gt;Does it ask for a password for:&lt;BR /&gt;sudo su - kumar -c "id"</description>
      <pubDate>Thu, 25 Nov 2010 00:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717717#M385591</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-25T00:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717718#M385592</link>
      <description>Hi Rajesh&lt;BR /&gt;&lt;BR /&gt;  You have many unassigned responses.&lt;BR /&gt;  127  of   315  responses to my questions.&lt;BR /&gt;Encourage the valuable Replies with approprtate points.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Jayakrishnan G Naik</description>
      <pubDate>Thu, 25 Nov 2010 06:57:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717718#M385592</guid>
      <dc:creator>Jayakrishnan G Naik</dc:creator>
      <dc:date>2010-11-25T06:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717719#M385593</link>
      <description>Hi Jayakrishnan G Naik,&lt;BR /&gt;&lt;BR /&gt;Sorry, it will not happen in future.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;After this command&lt;BR /&gt;&lt;BR /&gt;output&lt;BR /&gt;sudo su - kumar -c "id"&lt;BR /&gt;Password:&lt;BR /&gt;&lt;BR /&gt;kindly help to sort out this issue</description>
      <pubDate>Thu, 25 Nov 2010 12:37:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717719#M385593</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-25T12:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717720#M385594</link>
      <description>&amp;gt;Sorry, it will not happen in future.&lt;BR /&gt;&lt;BR /&gt;You need to retroactively assign points to all of your replies:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/pageList.do?userId=WW229563&amp;amp;listType=unassigned" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/pageList.do?userId=WW229563&amp;amp;listType=unassigned&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;sudo su - kumar -c "id"&lt;BR /&gt;Password:&lt;BR /&gt;&amp;gt;kindly help to sort out this issue&lt;BR /&gt;&lt;BR /&gt;This means that sudo is not switching to root for this particular user and/or command.&lt;BR /&gt;What is it configured to allow?</description>
      <pubDate>Thu, 25 Nov 2010 12:51:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717720#M385594</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-25T12:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717721#M385595</link>
      <description>i have configure in sudoers file&lt;BR /&gt;&lt;BR /&gt;/usr/bin/su - kumar&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Nov 2010 13:21:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717721#M385595</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-25T13:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717722#M385596</link>
      <description>&amp;gt;I have configure in sudoers file&lt;BR /&gt;/usr/bin/su - kumar&lt;BR /&gt;&lt;BR /&gt;Does it check to see that the "-c ..." is different?</description>
      <pubDate>Thu, 25 Nov 2010 13:36:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717722#M385596</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-25T13:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717723#M385597</link>
      <description>Sorry dennis,&lt;BR /&gt;&lt;BR /&gt;i am not understand your input</description>
      <pubDate>Fri, 26 Nov 2010 16:22:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717723#M385597</guid>
      <dc:creator>rajesh73</dc:creator>
      <dc:date>2010-11-26T16:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to write su in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717724#M385598</link>
      <description>&amp;gt;I am not understand your input&lt;BR /&gt;&lt;BR /&gt;Does sudo check for an exact match of the command and ALL the options or only a prefix match?&lt;BR /&gt;&lt;BR /&gt;Does your "/usr/bin/su - kumar" allow:&lt;BR /&gt;sudo su - kumar -c "id"&lt;BR /&gt;sudo su - kumar -c "cd /home/kumar/lic &amp;amp;&amp;amp; /path/to/lmstat lic"</description>
      <pubDate>Fri, 26 Nov 2010 16:59:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-write-su-in-shell-script/m-p/4717724#M385598</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-26T16:59:47Z</dc:date>
    </item>
  </channel>
</rss>

