<?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 find a user ID from a shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499778#M20664</link>
    <description>You could use&lt;BR /&gt;#user_id=`id -u ` ( variable that stores the user id -&amp;gt; 0 for root )&lt;BR /&gt;# user_account=`id -nu` ( variable that stores the account )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;federico</description>
    <pubDate>Thu, 01 Mar 2001 11:41:23 GMT</pubDate>
    <dc:creator>federico_3</dc:creator>
    <dc:date>2001-03-01T11:41:23Z</dc:date>
    <item>
      <title>How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499775#M20661</link>
      <description>Could someone please tell me what shell script command can be used within a shell  script to find out who is presntly invoking the script ?&lt;BR /&gt;&lt;BR /&gt;and store that in a variable ? &lt;BR /&gt;&lt;BR /&gt;we are using HP-ux 10.20&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Thu, 01 Mar 2001 11:23:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499775#M20661</guid>
      <dc:creator>Nalin Uduwawala_1</dc:creator>
      <dc:date>2001-03-01T11:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499776#M20662</link>
      <description>The "id" command.&lt;BR /&gt;&lt;BR /&gt;You can do something akin to:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;X=`id -nu`&lt;BR /&gt;echo $X&lt;BR /&gt;&lt;BR /&gt;X is set to the name of the invoking user.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2001 11:34:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499776#M20662</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2001-03-01T11:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499777#M20663</link>
      <description>hmmm, it's early and I haven't had my coffee yet...&lt;BR /&gt;&lt;BR /&gt;echo $LOGNAME&lt;BR /&gt;&lt;BR /&gt;will also give you what you want.</description>
      <pubDate>Thu, 01 Mar 2001 11:38:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499777#M20663</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2001-03-01T11:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499778#M20664</link>
      <description>You could use&lt;BR /&gt;#user_id=`id -u ` ( variable that stores the user id -&amp;gt; 0 for root )&lt;BR /&gt;# user_account=`id -nu` ( variable that stores the account )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;federico</description>
      <pubDate>Thu, 01 Mar 2001 11:41:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499778#M20664</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-03-01T11:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499779#M20665</link>
      <description>Jim,&lt;BR /&gt;&lt;BR /&gt;which is better to be used with elm to send a file (a report that the user invoked or a message that something happened) ?&lt;BR /&gt;&lt;BR /&gt;are both solutions equally valid ?&lt;BR /&gt;&lt;BR /&gt;Sorry if I woke you up !!!! But you have to get up sometime !!!!!!!!!!.&lt;BR /&gt;&lt;BR /&gt;Thanks again. Have a good day.</description>
      <pubDate>Thu, 01 Mar 2001 11:42:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499779#M20665</guid>
      <dc:creator>Nalin Uduwawala_1</dc:creator>
      <dc:date>2001-03-01T11:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499780#M20666</link>
      <description>You're confusing my caffeine-starved brain here...are you asking whether it's better to send a report as an attachment or to send a notification that a report has been generated?  Is the person you're sending the e-mail to, the same person you needed to get the username for?&lt;BR /&gt;&lt;BR /&gt;Please clarify what it is you need to do...</description>
      <pubDate>Thu, 01 Mar 2001 11:54:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499780#M20666</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2001-03-01T11:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499781#M20667</link>
      <description>Yeah You seem to had a pretty busy night and apologies for making things worse.&lt;BR /&gt;&lt;BR /&gt;a user logs in to hpux based application.&lt;BR /&gt;&lt;BR /&gt;user runs a command from the application (which for eg: generates a report). This user should receive the report in his e-mail. From the application a shell script will be invoked to run the report or to generate the message.&lt;BR /&gt;&lt;BR /&gt;The userid within the application and UNIX are identical. Infact the application picks it up from UNIX.&lt;BR /&gt;&lt;BR /&gt;so what I would like to know is who ran the script so that within the script I can say &lt;BR /&gt;"elm $logname"  ?  &lt;BR /&gt;&lt;BR /&gt;Have I confused you further ? I hope not.&lt;BR /&gt;&lt;BR /&gt;I am not certain what caffeine does to a confused mind. But some Jack Daniels may help !!!!&lt;BR /&gt;&lt;BR /&gt;have a good day</description>
      <pubDate>Thu, 01 Mar 2001 12:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499781#M20667</guid>
      <dc:creator>Nalin Uduwawala_1</dc:creator>
      <dc:date>2001-03-01T12:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499782#M20668</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;just another solution:&lt;BR /&gt;&lt;BR /&gt;elm `whoami` ...&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 01 Mar 2001 12:14:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499782#M20668</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-03-01T12:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499783#M20669</link>
      <description>OK, I think I follow...&lt;BR /&gt;&lt;BR /&gt;1. The user logs in to an application.&lt;BR /&gt;2. The application generates a report&lt;BR /&gt;3. The application calls a script to e-mail the report to the user&lt;BR /&gt;&lt;BR /&gt;Then yes, invoking "elm $LOGNAME" should send e-mail to your user.</description>
      <pubDate>Thu, 01 Mar 2001 12:30:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499783#M20669</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2001-03-01T12:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499784#M20670</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for all the good suggestions. &lt;BR /&gt;&lt;BR /&gt;JIm I will go with your suggestion. However with a small change. &lt;BR /&gt;&lt;BR /&gt;elm $logname does not work for some reason&lt;BR /&gt;It should be elm $$logname.&lt;BR /&gt;&lt;BR /&gt;This is not the full solution as the elm editor pops up even with the above command.&lt;BR /&gt;&lt;BR /&gt;I have to find a way to stop it. &lt;BR /&gt;&lt;BR /&gt;The mail is then routed through smtp to NOtes!! where the user while eating his breakfast or sipping his cup of tea gets to read the report while we toil in the engine room !!!!.&lt;BR /&gt;&lt;BR /&gt;Thanks again guys.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2001 12:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499784#M20670</guid>
      <dc:creator>Nalin Uduwawala_1</dc:creator>
      <dc:date>2001-03-01T12:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499785#M20671</link>
      <description>elm is really designed for interactive use although with the right options, it can be used as a batch mailer.&lt;BR /&gt;&lt;BR /&gt;Here are much easiest methos in a script:&lt;BR /&gt;&lt;BR /&gt;cat report_name | mailx -s"Some subject" $LOGNAME &lt;BR /&gt;&lt;BR /&gt;cat report_name | mailx -s"Some subject" $(/usr/bin/id -nu)&lt;BR /&gt;&lt;BR /&gt;I think of mailx as the script mailer...only 3 things are required: -s"a useful subject", the email address and stdin with the text needing to be mailed.</description>
      <pubDate>Thu, 01 Mar 2001 12:58:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499785#M20671</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-03-01T12:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499786#M20672</link>
      <description>I have used logname as opposed to LOGNAME .&lt;BR /&gt;&lt;BR /&gt;My apologies for saying $LOGNAME doesnot work.&lt;BR /&gt;&lt;BR /&gt;However when I use mailx it gives a strange message to say "The flags you gave are used only when sending mail.""&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/usr/bin/id not found !!!!.&lt;BR /&gt;&lt;BR /&gt;Is there a central place within ux 10.2 where I can define the smtp mail addresses of the users that can be accessed by mailx or elm as aliasses ? &lt;BR /&gt;&lt;BR /&gt;Else I will have to type in the lot in the script with a if/case structure. &lt;BR /&gt;&lt;BR /&gt;Thanks again for all the support. &lt;BR /&gt;&lt;BR /&gt;I am trying to save some trees !!!!!!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2001 13:16:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499786#M20672</guid>
      <dc:creator>Nalin Uduwawala_1</dc:creator>
      <dc:date>2001-03-01T13:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499787#M20673</link>
      <description>try this&lt;BR /&gt;&lt;BR /&gt;user=`whoami`&lt;BR /&gt;report=/dir/dir/dir/reportname&lt;BR /&gt;mailx -s "subject" ${user} &amp;lt; ${report}</description>
      <pubDate>Thu, 01 Mar 2001 14:03:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499787#M20673</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-03-01T14:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499788#M20674</link>
      <description>If your having problems using "mailx" you could use "mail"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo "User is $LOGNAME" | mail root &amp;amp;&lt;BR /&gt;&lt;BR /&gt;However mailx with the following syntax should work. &lt;BR /&gt;&lt;BR /&gt;echo "User is $LOGNAME" | mailx -s 'Someone has used your script' user@mail.domain.com</description>
      <pubDate>Thu, 01 Mar 2001 21:02:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499788#M20674</guid>
      <dc:creator>Brian Markus</dc:creator>
      <dc:date>2001-03-01T21:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499789#M20675</link>
      <description>Just a note: /usr/bin/id not found?&lt;BR /&gt;&lt;BR /&gt;That is the correct pathname for the id command on HP-UX 10.xx.  What happens when you type id? It it reports your id information, type the command:&lt;BR /&gt;&lt;BR /&gt;whence -v id&lt;BR /&gt;&lt;BR /&gt;/usr/bin/id must exist (along with hundreds of other commands)</description>
      <pubDate>Fri, 02 Mar 2001 04:02:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499789#M20675</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-03-02T04:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a user ID from a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499790#M20676</link>
      <description>Dear Nalin,&lt;BR /&gt;&lt;BR /&gt;I've found out that some users (on HP-UX 10.20) are clever enough to run certain scripts as if the are another user. When using options above you can find out the user they have become. &lt;BR /&gt;If you use &lt;BR /&gt;&lt;BR /&gt;" who -m " &lt;BR /&gt;&lt;BR /&gt;you will find out the first login id. &lt;BR /&gt;&lt;BR /&gt;If you have prevented you system against login as root user and anyone needs to login by there own name first, you will be able to track down the write user. To mail the outcome, just use on of the options above.&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2001 08:20:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-find-a-user-id-from-a-shell-script/m-p/2499790#M20676</guid>
      <dc:creator>Arthur Pols</dc:creator>
      <dc:date>2001-03-02T08:20:25Z</dc:date>
    </item>
  </channel>
</rss>

