<?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: Using 2 kind of shell only in 1 script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690732#M103075</link>
    <description>then ...&lt;BR /&gt;how can i use save a variable in a word invoking a command .. this is:&lt;BR /&gt;&lt;BR /&gt;$(....) or `...`&lt;BR /&gt;&lt;BR /&gt;because when i use csh the output is a message error: "Ambigous" and if i use ksh this run o.k.&lt;BR /&gt;&lt;BR /&gt;do you know how can i save a result executed from a command in a variable?&lt;BR /&gt;&lt;BR /&gt;ksh --&amp;gt; result=$(ls -l | awk '{ print $1 }')&lt;BR /&gt;&lt;BR /&gt;chs --&amp;gt; Â¿? can i use $(..) or `..`?? what do i use??&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
    <pubDate>Tue, 13 Dec 2005 19:05:46 GMT</pubDate>
    <dc:creator>Manuales</dc:creator>
    <dc:date>2005-12-13T19:05:46Z</dc:date>
    <item>
      <title>Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690730#M103073</link>
      <description>Hi....&lt;BR /&gt;can i use two shells in 1 script, i mean, like next:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;cd /home/files/&lt;BR /&gt;aa=`ls -l | grep earn | awk '{ print $NF }'`&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;echo $aa&lt;BR /&gt;&lt;BR /&gt;this is because with csh i have a message error when i use awk command:&lt;BR /&gt;aa1=`ls -l | grep earn | awk '{ print $NF }'`: Ambiguous.&lt;BR /&gt;&lt;BR /&gt;My question is:&lt;BR /&gt;can i use two shells at same script:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;cd /home/files/&lt;BR /&gt;aa=`ls -l | grep earn | awk '{ print $NF }'`&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;echo $aa&lt;BR /&gt;....&lt;BR /&gt;...&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;....&lt;BR /&gt;when i change kind of shell, can i continue executing command with another sintaxis depending the shell? this is in first part i want obtain a variable with awk command with ksh and then that variable i need use it with others sintaxis with other shell named csh ..can i do it? will i have some problem if i use it in this form?&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Tue, 13 Dec 2005 18:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690730#M103073</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-13T18:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690731#M103074</link>
      <description>Not within the same file. You could have a ksh call out to a csh script and return the results.&lt;BR /&gt; &lt;BR /&gt;It would be better to stick to one script language. "csh" has become less popular I think, and all the new enhancements are being put onto the Posix-sh, which is "ksh" like in most ways.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Tue, 13 Dec 2005 18:59:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690731#M103074</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-13T18:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690732#M103075</link>
      <description>then ...&lt;BR /&gt;how can i use save a variable in a word invoking a command .. this is:&lt;BR /&gt;&lt;BR /&gt;$(....) or `...`&lt;BR /&gt;&lt;BR /&gt;because when i use csh the output is a message error: "Ambigous" and if i use ksh this run o.k.&lt;BR /&gt;&lt;BR /&gt;do you know how can i save a result executed from a command in a variable?&lt;BR /&gt;&lt;BR /&gt;ksh --&amp;gt; result=$(ls -l | awk '{ print $1 }')&lt;BR /&gt;&lt;BR /&gt;chs --&amp;gt; Â¿? can i use $(..) or `..`?? what do i use??&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Tue, 13 Dec 2005 19:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690732#M103075</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-13T19:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690733#M103076</link>
      <description>I'm not well versed in csh. I prefer ksh myself...&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Tue, 13 Dec 2005 19:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690733#M103076</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-13T19:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690734#M103077</link>
      <description>You can call scripts from other scripts, I prefer ksh, bash, or bourne. Any thing I want to do I generally can write in bash or ksh and do anything that could possibly be done with csh .. &lt;BR /&gt;&lt;BR /&gt;awk can be ran from within any script.. &lt;BR /&gt;&lt;BR /&gt;if you wanted to "kick off a subshell" &lt;BR /&gt;&lt;BR /&gt;you would right a second script.. exiting the subshell becomes the problem. &lt;BR /&gt;&lt;BR /&gt;Example: &lt;BR /&gt;&lt;BR /&gt;Program 1: &lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;cd /home/files/&lt;BR /&gt;aa=`ls -l | grep earn | awk '{ print $NF }'`&lt;BR /&gt;export aa&lt;BR /&gt;&lt;BR /&gt;Program 2: &lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;echo $aa&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The #!/shell command line must be in the first line of the script. &lt;BR /&gt;&lt;BR /&gt;Problem exists if any other variables exist that are required may or may not be passed to the subshell. &lt;BR /&gt;&lt;BR /&gt;If you "launch a shell" from with in the program eliminate the "#!" as this winds up being a Comment on any other line then line #1. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 09:51:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690734#M103077</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2005-12-14T09:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690735#M103078</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;in csh you have to use setenv to assign variables.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 10:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690735#M103078</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2005-12-14T10:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690736#M103079</link>
      <description>According to "man csh", the back ticks should work ok.&lt;BR /&gt; &lt;BR /&gt;set aa=`ls -l | grep earn | awk '{ print $NF }'`&lt;BR /&gt; &lt;BR /&gt;should not have an error under csh. Note the "set" command is required when setting csh variables.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Wed, 14 Dec 2005 10:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690736#M103079</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-14T10:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690737#M103080</link>
      <description>If you want to use csh, use the set command as noted above, as in:&lt;BR /&gt;   set aa=`ls -l | grep earn | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;for csh use:&lt;BR /&gt;   aa=`ls -l | grep earn | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;The question I have, is why are you going to all this trouble to get a list of filenames into a variable?  &lt;BR /&gt;&lt;BR /&gt;Doesn't `ls *earn*` return the result your looking for?</description>
      <pubDate>Wed, 14 Dec 2005 11:18:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690737#M103080</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2005-12-14T11:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690738#M103081</link>
      <description>If you want to use csh, use the set command as noted above, as in:&lt;BR /&gt;   set aa=`ls -l | grep earn | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;&amp;lt;&lt;OOPS&gt;&amp;gt; I meant:&lt;BR /&gt;for ksh use:&lt;BR /&gt;   aa=`ls -l | grep earn | awk '{print $NF}'&lt;BR /&gt;&lt;BR /&gt;The question I have, is why are you going to all this trouble to get a list of filenames into a variable?  &lt;BR /&gt;&lt;BR /&gt;Doesn't `ls *earn*` return the result your looking for?&lt;/OOPS&gt;</description>
      <pubDate>Wed, 14 Dec 2005 11:19:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690738#M103081</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2005-12-14T11:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690739#M103082</link>
      <description>what is the sintax to use "if" for csh?&lt;BR /&gt;&lt;BR /&gt;if [[ ... ]]&lt;BR /&gt;Ã³r&lt;BR /&gt;if [ .. ]&lt;BR /&gt;or&lt;BR /&gt;if (....)&lt;BR /&gt;or&lt;BR /&gt;if (( ...))&lt;BR /&gt;&lt;BR /&gt;Thanks !!!</description>
      <pubDate>Wed, 14 Dec 2005 13:28:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690739#M103082</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690740#M103083</link>
      <description>Check this:&lt;BR /&gt;&lt;A href="http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Unix/CShellII.html" target="_blank"&gt;http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Unix/CShellII.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;if ( expr ) then&lt;BR /&gt;  commandlist-1&lt;BR /&gt;[else&lt;BR /&gt;  commandlist-2]&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 14 Dec 2005 13:36:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690740#M103083</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-14T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using 2 kind of shell only in 1 script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690741#M103084</link>
      <description>Thanks Oviwan  for the link ... &lt;BR /&gt;you guess my mind, i ned a link like this one , thanks !!!</description>
      <pubDate>Wed, 14 Dec 2005 13:45:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/using-2-kind-of-shell-only-in-1-script/m-p/3690741#M103084</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T13:45:39Z</dc:date>
    </item>
  </channel>
</rss>

