<?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: Script running  in shell, not in cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133650#M688564</link>
    <description>Why not just do like this in the top of your script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;. /path/to/.profile&lt;BR /&gt;&lt;BR /&gt;This will include the .profile and all the definitions in it (it's the "." that does it). This way if you change your .profile all your scripts will also recieve the changes :)&lt;BR /&gt;Just remember the space between "." and "/path". "./path" is not the same as ". /path".&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
    <pubDate>Mon, 06 Oct 2008 08:06:49 GMT</pubDate>
    <dc:creator>Fredrik.eriksson</dc:creator>
    <dc:date>2008-10-06T08:06:49Z</dc:date>
    <item>
      <title>Script running  in shell, not in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133646#M688560</link>
      <description>Hi all.&lt;BR /&gt;Is there a way to run  .profile file to read all the environment variables and execute a script in the same crontab line?&lt;BR /&gt;I run my shell fine in a ssh session, when a i run it from a cron , it does not run due to variables not assigned. I would preferto to read the .profile instead off add all the variables in each script. Thanks all!&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Oct 2008 14:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133646#M688560</guid>
      <dc:creator>Marco Camacho_1</dc:creator>
      <dc:date>2008-10-03T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script running  in shell, not in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133647#M688561</link>
      <description>While it is not ideal you can do:&lt;BR /&gt;&lt;BR /&gt;. /path/to/.profile ; /path/to/script&lt;BR /&gt;&lt;BR /&gt;in your crontab command.</description>
      <pubDate>Fri, 03 Oct 2008 14:25:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133647#M688561</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2008-10-03T14:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script running  in shell, not in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133648#M688562</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;additionally to sourcing, you should check the profile for commands like who, stty, ... which require the existence of a valid tty.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;if [ -t 1 ]&lt;BR /&gt;then stty kill ^K ...&lt;BR /&gt;fi&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 03 Oct 2008 15:32:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133648#M688562</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2008-10-03T15:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script running  in shell, not in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133649#M688563</link>
      <description>Thanks Peter &amp;amp; Patrick, i'll take in count your advices. Regards.&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Oct 2008 16:29:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133649#M688563</guid>
      <dc:creator>Marco Camacho_1</dc:creator>
      <dc:date>2008-10-03T16:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script running  in shell, not in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133650#M688564</link>
      <description>Why not just do like this in the top of your script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;. /path/to/.profile&lt;BR /&gt;&lt;BR /&gt;This will include the .profile and all the definitions in it (it's the "." that does it). This way if you change your .profile all your scripts will also recieve the changes :)&lt;BR /&gt;Just remember the space between "." and "/path". "./path" is not the same as ". /path".&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Mon, 06 Oct 2008 08:06:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-running-in-shell-not-in-cron/m-p/5133650#M688564</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2008-10-06T08:06:49Z</dc:date>
    </item>
  </channel>
</rss>

