<?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 Determining Where Script Was Started From in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210826#M168487</link>
    <description>I'm trying to consolidate the setting of environemnt variables into one location:  /etc/profile.  Then /etc/profile would be sourced at the start of all scripts to setup the environment regardless of whether the job was started from the command line or from cron.    I've put in logic to test whether the environemnt is interactive so we don't trip over terminal I/O:&lt;BR /&gt;&lt;BR /&gt;if [[ -t 0 ]]&lt;BR /&gt;then&lt;BR /&gt; do term-oriented stuff like tset, tabs, etc&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now I'm wondering if there's a way to tell if a script is started from the command line or if it's been started via cron.  The issue is that the /etc/copyright message gets displayed at the start of every script that's started from the command line - I would like to only see the /etc/copyright when I login.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 05 Mar 2004 12:15:07 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2004-03-05T12:15:07Z</dc:date>
    <item>
      <title>Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210826#M168487</link>
      <description>I'm trying to consolidate the setting of environemnt variables into one location:  /etc/profile.  Then /etc/profile would be sourced at the start of all scripts to setup the environment regardless of whether the job was started from the command line or from cron.    I've put in logic to test whether the environemnt is interactive so we don't trip over terminal I/O:&lt;BR /&gt;&lt;BR /&gt;if [[ -t 0 ]]&lt;BR /&gt;then&lt;BR /&gt; do term-oriented stuff like tset, tabs, etc&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now I'm wondering if there's a way to tell if a script is started from the command line or if it's been started via cron.  The issue is that the /etc/copyright message gets displayed at the start of every script that's started from the command line - I would like to only see the /etc/copyright when I login.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 12:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210826#M168487</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-03-05T12:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210827#M168488</link>
      <description>Hi Pete,&lt;BR /&gt;&lt;BR /&gt;I noticed from ps -ef my cron jobs have TTY as ?&lt;BR /&gt;&lt;BR /&gt;My command line jobs have TTY set to ttype3&lt;BR /&gt;&lt;BR /&gt;I know you are skilled with awk and can read the TTY characteristics.&lt;BR /&gt;&lt;BR /&gt;Usually cron has no TERM variable set, so that's how I'd approach it.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 05 Mar 2004 12:22:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210827#M168488</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-03-05T12:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210828#M168489</link>
      <description>Jobs started from cron will not have tty attached to it. ps -ef will show ? under tty, while if started from command line, it will show some tty name.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 05 Mar 2004 12:27:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210828#M168489</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-03-05T12:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210829#M168490</link>
      <description>One method to distinguish those processes started by cron would be to examine ${PPID} and compare it the cron's PID. Of course, if a process has been spawned by another process that was a child of cron this simple method would miss it. To do it right, you have to climb the process tree until either the PPID is 1 (init) or the PPID equals the PID of cron.&lt;BR /&gt;&lt;BR /&gt;You can avoid this expensive test most of the time, by first using -t 0. Iff you are willing to assume that anything that has a tty device assigned to stdin, is by definition interactive and thus could be spawned by cron. Of course, it is possible to contrive a situation where stdin is connected to a tty device and yet was started by cron. &lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 12:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210829#M168490</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-05T12:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210830#M168491</link>
      <description>Hi Pete,&lt;BR /&gt;&lt;BR /&gt;One another way is to check the PPID of the shell spawned by the script is of 'cron''s. For ex., I put the following&lt;BR /&gt;&lt;BR /&gt;PID=$$&lt;BR /&gt;PPID=$(ps -ef|awk -v pid=$PID '$2 == pid  {print $3}')&lt;BR /&gt;PPPID=$(ps -ef|awk -v pid=$PPID '$2 == pid  {print $3}')&lt;BR /&gt;echo $PID, $PPID, $PPPID &amp;gt; /tmp/cron.log&lt;BR /&gt;&lt;BR /&gt;In there PPPID corresponds to /usr/sbin/cron.&lt;BR /&gt;&lt;BR /&gt;You can use UNIX95 to do the actual work. Above is only to give you an idea.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 05 Mar 2004 12:30:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210830#M168491</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-03-05T12:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210831#M168492</link>
      <description>if [ -z "$TERM" ]&lt;BR /&gt;then&lt;BR /&gt;   echo "No terminal" &amp;gt; /tmp/log&lt;BR /&gt;else&lt;BR /&gt;   cat /etc/copyright&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Check out the term logic in my /etc/profile, which I'm attaching. It might help.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 05 Mar 2004 12:31:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210831#M168492</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-03-05T12:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210832#M168493</link>
      <description>Hey Pete,&lt;BR /&gt;&lt;BR /&gt;How about checking the PPID of the process and if the parent is NOT telnetd then don't display /etc/copyright.&lt;BR /&gt;&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;PP=$(ps -p $PPID | grep -v PID | awk '{print $4}')&lt;BR /&gt;&lt;BR /&gt;if [ "${PPID}" = "telnetd" ] ; then&lt;BR /&gt; cat /etc/copyright&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 12:32:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210832#M168493</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-03-05T12:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210833#M168494</link>
      <description>If the script is started from cron, cron will have an entry for this. Scripts started from command line altogether different.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 05 Mar 2004 12:36:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210833#M168494</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-03-05T12:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210834#M168495</link>
      <description>Pete &lt;BR /&gt;&lt;BR /&gt;Sorry but I had to do it.&lt;BR /&gt;&lt;BR /&gt;1.   If it has coffee stains on it I would suggest your desk.&lt;BR /&gt;&lt;BR /&gt;2.   If it is sandy - perhaps the beach.&lt;BR /&gt;&lt;BR /&gt;3.   If wet the bathroom.&lt;BR /&gt;&lt;BR /&gt;4.   If cold the frezer.&lt;BR /&gt;&lt;BR /&gt;5.   If cold and dry the comms room.&lt;BR /&gt;&lt;BR /&gt;6.   If wet and cold London.&lt;BR /&gt;&lt;BR /&gt;7.   If it smells salty the Titanic.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TGIF&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Fri, 05 Mar 2004 12:39:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210834#M168495</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2004-03-05T12:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210835#M168496</link>
      <description>OK, my script don't work right!  It would have to be if the parent of the parent is telnetd then display /etc/copyright.&lt;BR /&gt;&lt;BR /&gt;I'm still trying to figure that one out.  It's a good exercise for a friday.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 12:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210835#M168496</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-03-05T12:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210836#M168497</link>
      <description>Actually, I think all the above solutions could miss out.  Even walking the process tree doesn't always work (though you have to be making a bit of an effort for your script to be owned by init).&lt;BR /&gt; &lt;BR /&gt;I think RAC is the closest though perhaps the lowest tech.  If your $* matches a crontab entry AND the time is the same as that entries time in cron you are going to be pretty damn close.&lt;BR /&gt; &lt;BR /&gt;Alternatively, why don't you prefix all cron entries with "export FROMCRON=1".  Then test for this variable in your /etc/profile.  You could even have a cron job that inserts ths into all the cron entries taht haven't got one already.</description>
      <pubDate>Fri, 05 Mar 2004 12:45:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210836#M168497</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-05T12:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210837#M168498</link>
      <description>Pete&lt;BR /&gt;&lt;BR /&gt;Can you not put a test in  /etc/profile to see what is reading it and if not a login sequence then do not display /etc/copyright.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Fri, 05 Mar 2004 12:53:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210837#M168498</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2004-03-05T12:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210838#M168499</link>
      <description>Nice task,&lt;BR /&gt;&lt;BR /&gt;tried and verified this ! Get rid of the "echo" stuff when tested.&lt;BR /&gt;Have fun&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;set `ps -ef | grep cron | grep -v grep`&lt;BR /&gt;PID_CRON=$2&lt;BR /&gt;NEXT_PID=$$&lt;BR /&gt;while [ $NEXT_PID -ne 1 ] &amp;amp;&amp;amp; [ $NEXT_PID -ne $PID_CRON ]&lt;BR /&gt;do&lt;BR /&gt;  set `ps -fp $NEXT_PID | grep -v 'UID   PID  PPID'`&lt;BR /&gt;  echo PID $NEXT_PID has parent $3&lt;BR /&gt;  NEXT_PID=$3&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;if [ $NEXT_PID -eq $PID_CRON ]&lt;BR /&gt;then&lt;BR /&gt;  echo I am a somehow grandchild of cron&lt;BR /&gt;else&lt;BR /&gt;  echo cron is no relative of mine&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#### End Script&lt;BR /&gt;&lt;BR /&gt;# mail&lt;BR /&gt;From root Fri Mar  5 18:58:03 MET 2004&lt;BR /&gt;Received: (from root@localhost)&lt;BR /&gt;        by cthhp10.cth.de (8.8.6 (PHNE_17190)/8.8.6) id SAA18916&lt;BR /&gt;        for root; Fri, 5 Mar 2004 18:58:02 +0100 (MET)&lt;BR /&gt;Date: Fri, 5 Mar 2004 18:58:02 +0100 (MET)&lt;BR /&gt;From: root&lt;BR /&gt;Message-Id: &amp;lt;200403051758.SAA18916@cthhp10.cth.de&amp;gt;&lt;BR /&gt;Subject: cron&lt;BR /&gt;&lt;BR /&gt;PID 18904 has parent 18903&lt;BR /&gt;PID 18903 has parent 677&lt;BR /&gt;I am a somehow grandchild of cron&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*************************************************&lt;BR /&gt;Cron: The previous message is the standard output&lt;BR /&gt;      and standard error of one of your crontab commands:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# cd /home/root&lt;BR /&gt;# ./script&lt;BR /&gt;PID 18943 has parent 18887&lt;BR /&gt;PID 18887 has parent 18886&lt;BR /&gt;PID 18886 has parent 567&lt;BR /&gt;PID 567 has parent 1&lt;BR /&gt;cron is no relative of mine&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 12:56:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210838#M168499</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-03-05T12:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210839#M168500</link>
      <description>OT:&lt;BR /&gt;&lt;BR /&gt;Good job SRI !&lt;BR /&gt;Congrats on the new salad !&lt;BR /&gt;Must just has happened !&lt;BR /&gt;Reading 20017 pts 20 secs ago !&lt;BR /&gt;&lt;BR /&gt;Go on&lt;BR /&gt;Volker</description>
      <pubDate>Fri, 05 Mar 2004 13:02:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210839#M168500</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-03-05T13:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210840#M168501</link>
      <description>OK, Folks.  I think I misled you on the goal here.  What I'm really trying to determine is if /etc/profile is being parsed by a login or a script (regardless of whether it from command line or cron).&lt;BR /&gt;&lt;BR /&gt;If it's because of login, I want to display /etc/copyright.  If from a script, then no copyright.&lt;BR /&gt;&lt;BR /&gt;I think Paula is closest to what I'm after with "Can you not put a test in /etc/profile to see what is reading it and if not a login sequence then do not display /etc/copyright."&lt;BR /&gt;I don't know how to test if it's a login sequence though.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 05 Mar 2004 13:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210840#M168501</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-03-05T13:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210841#M168502</link>
      <description>Pete &lt;BR /&gt;&lt;BR /&gt;Dont have a server to test this on but,&lt;BR /&gt;&lt;BR /&gt;Follow a normal login sequence through and find the pid of the read of /etc/profile&lt;BR /&gt;&lt;BR /&gt;Then in /etc/profile you have to put a sequence to look for this pid and if equal then skip the copyright bit.&lt;BR /&gt;&lt;BR /&gt;It might work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Fri, 05 Mar 2004 13:19:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210841#M168502</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2004-03-05T13:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210842#M168503</link>
      <description>OK, Paula, that sounds somewhat promising, but how do I follow a login sequence through?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 05 Mar 2004 13:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210842#M168503</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-03-05T13:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210843#M168504</link>
      <description>Rather than answering directly, I'll give you a hint now that the question is better defined: &lt;BR /&gt;&lt;BR /&gt;From a known login shell:&lt;BR /&gt;echo "${0}"&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;and again from within that shell:&lt;BR /&gt;sh&lt;BR /&gt;echo "${0}"&lt;BR /&gt;&lt;BR /&gt;Note the first character in ${0}; if it is a '-' is is assumed to be a login shell.</description>
      <pubDate>Fri, 05 Mar 2004 13:32:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210843#M168504</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-05T13:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210844#M168505</link>
      <description>Pete &lt;BR /&gt;&lt;BR /&gt;Good Question - its got me thinking.&lt;BR /&gt;&lt;BR /&gt;Fuser on /etc/profile in /etc/profile at start,&lt;BR /&gt;&lt;BR /&gt;fuser -v &amp;gt; /tmp/test-profile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;????&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Fri, 05 Mar 2004 13:32:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210844#M168505</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2004-03-05T13:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Where Script Was Started From</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210845#M168506</link>
      <description>Well no solution yet,&lt;BR /&gt;&lt;BR /&gt;but the best starter I think is to look up the own name. A login-shell always starts with a dash.&lt;BR /&gt;&lt;BR /&gt;# ps -ef | grep sh&lt;BR /&gt;    root     4     0  0  Aug 27  ?        11:19 unhashdaemon&lt;BR /&gt;    root 18982 18981  3 19:34:08 pts/ta    0:00 -sh&lt;BR /&gt;    root 19003 18982  3 19:34:59 pts/ta    0:00 grep sh&lt;BR /&gt;# echo $0&lt;BR /&gt;-sh&lt;BR /&gt;# sh&lt;BR /&gt;# ps -ef | grep sh&lt;BR /&gt;    root     4     0  0  Aug 27  ?        11:19 unhashdaemon&lt;BR /&gt;    root 19006 19004  3 19:35:13 pts/ta    0:00 grep sh&lt;BR /&gt;    root 18982 18981  0 19:34:08 pts/ta    0:00 -sh&lt;BR /&gt;    root 19004 18982  2 19:35:06 pts/ta    0:00 sh&lt;BR /&gt;# echo $0&lt;BR /&gt;sh&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Although I still have no idea how to validate it. May be it works directly with something like "... cut -c1 from_my_name ..."&lt;BR /&gt;&lt;BR /&gt;Volker&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Volker</description>
      <pubDate>Fri, 05 Mar 2004 13:33:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-where-script-was-started-from/m-p/3210845#M168506</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-03-05T13:33:48Z</dc:date>
    </item>
  </channel>
</rss>

