<?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: /etc/profile   Specify a parameter with this command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003285#M778274</link>
    <description>Do you want to run the job as root or as sybase?&lt;BR /&gt;&lt;BR /&gt;If it is syabse then allow sybase to run by adding into cron.allow</description>
    <pubDate>Thu, 14 Sep 2006 08:49:20 GMT</pubDate>
    <dc:creator>IT_2007</dc:creator>
    <dc:date>2006-09-14T08:49:20Z</dc:date>
    <item>
      <title>/etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003284#M778273</link>
      <description>When I log in to UNIX the /etc/profile script seems to run fine.  When we &lt;BR /&gt;su - sybase -c "/path/to/script_name"&lt;BR /&gt;thru a cron job we get this error.  How can I not get this error?&lt;BR /&gt;&lt;BR /&gt;Usage:  who [-rbtpludAasHTqRm] [am i] [utmp_like_file]&lt;BR /&gt;&lt;BR /&gt;r       run level&lt;BR /&gt;b       boot time&lt;BR /&gt;t       time changes&lt;BR /&gt;p       processes other than getty or users&lt;BR /&gt;l       login processes&lt;BR /&gt;u       useful information&lt;BR /&gt;d       dead processes&lt;BR /&gt;A       accounting information&lt;BR /&gt;a       all (rbtpludA options)&lt;BR /&gt;s       short form of who (no time since last output or pid)&lt;BR /&gt;H       print header&lt;BR /&gt;T       status of tty (+ writable, - not writable, x exclusive open, ? hung)&lt;BR /&gt;q       quick who&lt;BR /&gt;R       print host name&lt;BR /&gt;/etc/profile[45]: test: Specify a parameter with this command.</description>
      <pubDate>Thu, 14 Sep 2006 08:45:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003284#M778273</guid>
      <dc:creator>Don Jessen</dc:creator>
      <dc:date>2006-09-14T08:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: /etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003285#M778274</link>
      <description>Do you want to run the job as root or as sybase?&lt;BR /&gt;&lt;BR /&gt;If it is syabse then allow sybase to run by adding into cron.allow</description>
      <pubDate>Thu, 14 Sep 2006 08:49:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003285#M778274</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-14T08:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: /etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003286#M778275</link>
      <description>Don,&lt;BR /&gt;if you running through cron, you don't have a terminal attached to the process.&lt;BR /&gt;So your who command will not work, if you are looking for session information. If the result of the who command is undefined, your test in line 45 will have nothing to compare.&lt;BR /&gt;&lt;BR /&gt;Change your /etc/profile to check wether you are running from termianl or cron.</description>
      <pubDate>Thu, 14 Sep 2006 08:50:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003286#M778275</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-14T08:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: /etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003287#M778276</link>
      <description>Look at /etc/profile and see what is on line 45. I suspect it will have something to do with a tty which isn't being set since you're running it from cron.&lt;BR /&gt;&lt;BR /&gt;All commands having to do with an interactive tty should be encased in an &lt;BR /&gt;&lt;BR /&gt;if [ -t 0 ]; then&lt;BR /&gt;... # interactive&lt;BR /&gt;else&lt;BR /&gt;... # not interactive&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;block.&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 14 Sep 2006 08:54:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003287#M778276</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-09-14T08:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: /etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003288#M778277</link>
      <description>Hi,&lt;BR /&gt;Launching a job by cron means batch mode, /etc/profile tests your terminal... there is no easy way to bypass, the best would be if you need the env setting of sybase to recuperate what you need in a  lets say profile.sybase, put this in your /path/to/script_name at the beginning like . /path/to/profile.sybase and execute your cron line su without the -:&lt;BR /&gt;su sybase -c "/path/to/script_name"&lt;BR /&gt;Or you would have to add tests for interactive shells in /etc/profile /~HOME/sybase/.profile...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Victor</description>
      <pubDate>Thu, 14 Sep 2006 08:58:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003288#M778277</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2006-09-14T08:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: /etc/profile   Specify a parameter with this command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003289#M778278</link>
      <description>I used Jonathan's solution.&lt;BR /&gt;if [ -t 0 ]; then&lt;BR /&gt;... # interactive&lt;BR /&gt;else&lt;BR /&gt;... # not interactive&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;It worked like a charm.  Was very self documenting as to what it did, and what to do (I am not a UNIX admin).&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Sep 2006 11:35:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/etc-profile-specify-a-parameter-with-this-command/m-p/5003289#M778278</guid>
      <dc:creator>Don Jessen</dc:creator>
      <dc:date>2006-09-14T11:35:53Z</dc:date>
    </item>
  </channel>
</rss>

