<?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: running a csh script from a ksh script, and staying in the same shell... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404394#M201529</link>
    <description>from the ksh shell you don't, but if you were in a csh shell then you would "source filename". &lt;BR /&gt;&lt;BR /&gt;the solution is to not write stuff in csh's&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
    <pubDate>Wed, 20 Oct 2004 13:34:23 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2004-10-20T13:34:23Z</dc:date>
    <item>
      <title>running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404393#M201528</link>
      <description>I have a ksh script from where I have to run another script from there. I need this script to run in the same shell. &lt;BR /&gt;My problem is that I dont know if the script, which is a parameter, is in ksh or csh. &lt;BR /&gt;In ksh there is no problem since I can just write ". scriptToRun". &lt;BR /&gt;But if the script is in csh, how can I make "source" on it?&lt;BR /&gt;Thanx</description>
      <pubDate>Wed, 20 Oct 2004 13:09:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404393#M201528</guid>
      <dc:creator>caroline_6</dc:creator>
      <dc:date>2004-10-20T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404394#M201529</link>
      <description>from the ksh shell you don't, but if you were in a csh shell then you would "source filename". &lt;BR /&gt;&lt;BR /&gt;the solution is to not write stuff in csh's&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Oct 2004 13:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404394#M201529</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2004-10-20T13:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404395#M201530</link>
      <description>ksh code is incompatible with csh code. If you are running a ksh script, you can't "source" in a csh script and expect it to work. The script will be interpretted by ksh and probabily not work.&lt;BR /&gt; &lt;BR /&gt;Why is it important that the csh script run in the same shell as your ksh script?&lt;BR /&gt; &lt;BR /&gt;If it is a matter of retaining variables between the 2 scripts, then their are other ways to do.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 20 Oct 2004 13:53:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404395#M201530</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-20T13:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404396#M201531</link>
      <description>The . (dot) command is a directive to the shell to interpret (source) the commands. Normally, all shell scripts should start with the courtesy loader command as in:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt; &lt;BR /&gt;but in the case of sourcing a file, csh will read the commands in the ksh script and interpret them accordingly. In csh, the commnand is source as in:&lt;BR /&gt; &lt;BR /&gt;source scriptToRun&lt;BR /&gt; &lt;BR /&gt;I would make sure every script is correctly written with the above header. Ideally, csh should never be used for server work. Do you have an example of the ksh scriptToRun?</description>
      <pubDate>Wed, 20 Oct 2004 13:59:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404396#M201531</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-10-20T13:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404397#M201532</link>
      <description>If you need a reference for management or other admins as to why you shouldn't script in csh, see here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/" target="_blank"&gt;http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Wed, 20 Oct 2004 14:15:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404397#M201532</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2004-10-20T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404398#M201533</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;Thanx for the quick answers.&lt;BR /&gt;Ok...why do I want to run a csh script when mine is in ksh?&lt;BR /&gt;Because the 2nd script is given by the client, to initialize the environment, and I did not want to ask him to write like this or like that.&lt;BR /&gt;What is important for me, is to get in the ksh parent script, my script, all the variables that were initialized in the client script that I have to run...without caring if the client script is written in csh, ksh or something else...&lt;BR /&gt;any idea how I can export to my shell the variables of the 2nd script, without caring which kind of script it is?&lt;BR /&gt;I have the feeling that there is no way for that and that I'll have to write in the release notes that the script should be written in ksh...:-(</description>
      <pubDate>Sun, 24 Oct 2004 01:46:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404398#M201533</guid>
      <dc:creator>caroline_6</dc:creator>
      <dc:date>2004-10-24T01:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404399#M201534</link>
      <description>If the csh script is being used to set up environmental variables, then you could pass the variables to your ksh script via the following scenario-&lt;BR /&gt; &lt;BR /&gt;client.csh&lt;BR /&gt;----------&lt;BR /&gt;set myvar1=hello&lt;BR /&gt;set myvar2=world&lt;BR /&gt; &lt;BR /&gt;your.csh&lt;BR /&gt;--------&lt;BR /&gt;source client.csh&lt;BR /&gt;tmpname=/tmp/dummyfile&lt;BR /&gt;echo "myvar1=$myvar1" &amp;gt;$tmpname&lt;BR /&gt;echo "myvar2=$myvar2" &amp;gt;&amp;gt;$tmpname&lt;BR /&gt; &lt;BR /&gt;your.ksh&lt;BR /&gt;--------&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;csh your.csh&lt;BR /&gt;. /tmp/dummyfile&lt;BR /&gt; &lt;BR /&gt;This works by saving the environment variables into a /tmp file and then sourcing that file into the ksh environment.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 25 Oct 2004 09:29:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404399#M201534</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-25T09:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404400#M201535</link>
      <description>Hi Rod&lt;BR /&gt;&lt;BR /&gt;Well, if I knew what are the variables initialized, I was doing that...But I have no idea...&lt;BR /&gt;I guess there is no way to export the variables of a csh script, from a ksh script, without knowing the name of those variables...&lt;BR /&gt;&lt;BR /&gt;Thanx anyway</description>
      <pubDate>Mon, 25 Oct 2004 10:05:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404400#M201535</guid>
      <dc:creator>caroline_6</dc:creator>
      <dc:date>2004-10-25T10:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: running a csh script from a ksh script, and staying in the same shell...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404401#M201536</link>
      <description>Here is something that will get all the variables.&lt;BR /&gt; &lt;BR /&gt;echo "source ttt\nset" | csh | sed -e 's/\t/=/' -e '/^path/d' &amp;gt;/tmp/dumyfile&lt;BR /&gt;. /tmp/dumyfile&lt;BR /&gt; &lt;BR /&gt;This will slurp in all variables generated by the csh script.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt; &lt;BR /&gt;(PS- Points are a way to indicate how well a solution fits your problem.)</description>
      <pubDate>Mon, 25 Oct 2004 10:35:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-a-csh-script-from-a-ksh-script-and-staying-in-the-same/m-p/3404401#M201536</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-25T10:35:59Z</dc:date>
    </item>
  </channel>
</rss>

