<?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: csh scripts and at/cron command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6758440#M497124</link>
    <description>&lt;P&gt;There was a difference in how you called at and how we are calling at.&amp;nbsp; We were using 'at -f script.sh now'.&amp;nbsp; Trying to run our scripts using "echo 'script.sh' | at now" worked for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assistance&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2015 14:51:07 GMT</pubDate>
    <dc:creator>SteveMedals</dc:creator>
    <dc:date>2015-06-24T14:51:07Z</dc:date>
    <item>
      <title>csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757986#M497120</link>
      <description>&lt;P&gt;We are in the process of migrating from Solaris to HP-UX and have a large number of scripts written in csh that are called from at or cron.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to get the at command to execute csh scripts as we don't have the time or resources to rewrite all of our scripts using the sh shell?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 15:38:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757986#M497120</guid>
      <dc:creator>SteveMedals</dc:creator>
      <dc:date>2015-06-23T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757988#M497121</link>
      <description>&lt;P&gt;at / cron doesn't care what the scripts are written in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make sure that all of your scripts run with the correct shell ALWAYS place the shell as the first line of the script, preceded by #!.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for all of the scripts you are moving from Solaris to HP-UX, just make sure that this is the VERY FIRST line in the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/csh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That way your script will execute with the C-shell.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 15:41:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757988#M497121</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2015-06-23T15:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757994#M497122</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The scripts are set up with "#!/usr/bin/csh" as the first line.&amp;nbsp; One of the first things our script has is a "source" command to pull in common variables.&amp;nbsp; The output from executing the at command is "sh[46]: source: not found." which tells me that it is not using the csh to execute.&amp;nbsp; Here is one of the simpler scripts we are trying to run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#!/usr/bin/csh&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# /*****************************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * PROJECT : TransMon *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * FUNCTION : *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * DESCRIPTION : Schedule the script load_transmon_schedule.sh *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * AUTHOR : Jaya Manoranjani Mekala *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * DATE : May 12 2007 *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# * OUTPUT : None *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo "TransMon starting on Westlake Cps1."&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source /opt/cps/transmon/scripts/load_control_transmon.var&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set to = "apdev"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set toPager = "apdevPager"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set subject = "Load TRANSMON Schedule Start is on HOLD"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set body = "load_transmon_schedule_start.sh was placed on HOLD."&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set execute = `echo "${transmon_sched_start}" | tr '[:lower:]' '[:upper:]'`&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set pagerSubject = "Load TRANSMON Schedule Load Error"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;set pagerBody = "Load TRANSMON Schedule Start is on HOLD as transmon_sched_start load status is: $execute"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo Execut is $execute&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo $body&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo $load&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 16:01:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6757994#M497122</guid>
      <dc:creator>SteveMedals</dc:creator>
      <dc:date>2015-06-23T16:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6758193#M497123</link>
      <description>&lt;P&gt;&amp;gt; at / cron doesn't care what the scripts are written in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I seldom use these things, so I know nothing, but that's what I'd've&lt;BR /&gt;said, and my quick test agreed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# uname -a&lt;BR /&gt;HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# ls -l ct*&lt;BR /&gt;-rwxr-xr-x 1 root sys 49 Jun 23 12:43 ct.csh&lt;BR /&gt;-rw-r--r-- 1 root sys 17 Jun 23 12:42 ct2.cs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# cat ct.csh&lt;BR /&gt;#!/usr/bin/csh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;source ~root/ct2.cs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo 'Done'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# cat ct2.cs&lt;BR /&gt;echo ' ct2.cs'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# date&lt;BR /&gt;Tue Jun 23 22:54:59 CDT 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dyi# echo '/root/ct.csh' | at 22:56&lt;BR /&gt;warning: commands will be executed using /usr/bin/sh&lt;BR /&gt;job 1435118160.a at Tue Jun 23 22:56:00 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; And the mail I got said:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From root@dyi.antinode.info Tue Jun 23 22:56:01 CDT 2015&lt;BR /&gt;[...]&lt;BR /&gt;Subject: at&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ct2.cs&lt;BR /&gt;Done&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*************************************************&lt;BR /&gt;Cron: The previous message is the standard output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and standard error of one of your at commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The "man" page also talks about "/usr/bin/sh" doing all the work, but&lt;BR /&gt;if the script itself has a "#!" line, then /usr/bin/sh should run that&lt;BR /&gt;interpreter, which is what seems to happen here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Does your script have "x" permission, and are you sure that you're&lt;BR /&gt;running the one which you think you're running?&amp;nbsp; Does it work if you run&lt;BR /&gt;it interactively?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 04:06:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6758193#M497123</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2015-06-24T04:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6758440#M497124</link>
      <description>&lt;P&gt;There was a difference in how you called at and how we are calling at.&amp;nbsp; We were using 'at -f script.sh now'.&amp;nbsp; Trying to run our scripts using "echo 'script.sh' | at now" worked for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assistance&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 14:51:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6758440#M497124</guid>
      <dc:creator>SteveMedals</dc:creator>
      <dc:date>2015-06-24T14:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: csh scripts and at/cron command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6759445#M497125</link>
      <description>&lt;P&gt;&amp;gt;We were using "at -f script.sh now".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This tells at(1) to fiddle with the source file and prefix the Posix shell script with more Posix shell commands.&amp;nbsp; Which won't work for the scummy C shell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at(1) says: Enter commands from ...&lt;/P&gt;&lt;P&gt;And it does say by the Posix shell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Trying to run our scripts using "echo 'script.sh' | at now" worked for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This tells at(1) to execute the script with the single command "script.sh" from the Posix shell.&lt;/P&gt;&lt;P&gt;You may want to make this more efficient by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; echo 'exec script.sh' | at now&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;at / cron doesn't care what the scripts are written in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quite the contrary, at(1) does but cron(1) doesn't.&lt;/P&gt;&lt;P&gt;(Unless for the latter you actually have a csh command in the crontab file. :-)&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 07:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/csh-scripts-and-at-cron-command/m-p/6759445#M497125</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-06-26T07:52:33Z</dc:date>
    </item>
  </channel>
</rss>

