<?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: Performance of Shell Scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145413#M801985</link>
    <description>Thanks Guys! &lt;BR /&gt;&lt;BR /&gt;I'm impressed by the information!</description>
    <pubDate>Tue, 16 Dec 2003 10:08:27 GMT</pubDate>
    <dc:creator>dude70_1</dc:creator>
    <dc:date>2003-12-16T10:08:27Z</dc:date>
    <item>
      <title>Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145409#M801981</link>
      <description>Guys,&lt;BR /&gt;&lt;BR /&gt;I am not an expert in unix OS. Can anybody shed info about the performance of shell &lt;BR /&gt;(K-shell) scripts compared to java and c programs. That will be very helpful!&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 19:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145409#M801981</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-15T19:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145410#M801982</link>
      <description>C programs are the most efficient since the code is completely compiled into machine language. Java is partially translated into a common base but must be run by a software engine to produce the desired activities. Shell scripts are interpreted line by line with no intermediate code generated. As such, all shell scripts have the potential to be quite slow compared to Java or C code. On the other hand, a shell script is much easier to code and test since it is just a collection of programs and some shell 'glue' to make the commands work.&lt;BR /&gt; &lt;BR /&gt;It is very important to note that there is no 'right' programming language. C (and C++ and others) require a fairly steep learning curve to produce error-free programs. The code must be edited, compiled and linked, run tests and repeat. Java is at a hiogher level with precompiled modules that mean less programming effort but versioning is a nightmare. And some of the Java libraries and modules are notoriously inefficient which can take days to track down.&lt;BR /&gt; &lt;BR /&gt;Shell scripts are quite easy to learn and while tracing and testing is quite easy, functions and subroutines can be clumsy to use and document. You'll find shell scripts invaluable to wrap around applications so that a consistent environment is available. Perl is the next step up in scripting. With more sophisticated structures and libraries, Perl is a great tool for more complex tasks that can be written quickly using an interpreter.</description>
      <pubDate>Mon, 15 Dec 2003 20:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145410#M801982</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-15T20:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145411#M801983</link>
      <description>There's not a whole lot that I can add to Bill's response except to say that if I were starting over, I would only learn enough shell to get by and do most of my development in Perl. Because Perl is translated to p-code, it's execution can be amazingly fast and in many cases can rival the performance of C/C++ --- especially since the majority of UNIX tasks are not CPU bound. Perl combines the best features of the shell, grep, sed, and awk --- and it's pattern matching is unrivaled. Tasks which might take hours to code in C can be done in minutes with Perl.</description>
      <pubDate>Mon, 15 Dec 2003 23:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145411#M801983</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-12-15T23:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145412#M801984</link>
      <description>It depends on what you want which is quicker.&lt;BR /&gt;&lt;BR /&gt;C is almost alway the fastest, though it needs to be programmed correctly which takes time. And the resulting program is limited to the machine(s) you compiled it for. Sometimes (especialy if it is a sysadmin tool) you need to port it to other OS's (flavour or even version) and CPU types.&lt;BR /&gt;&lt;BR /&gt;JAVA is portable and has quite nice GUI's to program, though those don't produce the fastest JAVA code. Again producing fast code takes time. The speed of the resulting program depends on your time spent optimizing and the amount of memory available. And of course the efficiency of the virtual machine under which a java program runs.&lt;BR /&gt;&lt;BR /&gt;K-shell scripts (though HP-UX uses POSIX shell nowadays) are mainly portable between OS-versions (sometimes minor adjustments are needed) and easy to write since the consist of the same commands you use on the command line. The speed can be good depending on what you want. Especially the time to write them, like said in Bill's explanation, is a major advantage and that is why a lot of tools are just shell scripts on must versions of Unix.&lt;BR /&gt;&lt;BR /&gt;Problem with shell scripts when doing difficult stuff is that you are not only coding in the shell, but using awk, sed and a lot of other tools too. That is why nowadays a lot is written in perl, a scripting/programming language that can do all inside one tool. The shell has to start all those other commands as it reaches them, which can slow a script down.&lt;BR /&gt;Perl 'compiles' when starting the script, which is efficient when doing things like loops, since you don't have to compile every command again by the time the program reaches it.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Dec 2003 02:53:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145412#M801984</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-16T02:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145413#M801985</link>
      <description>Thanks Guys! &lt;BR /&gt;&lt;BR /&gt;I'm impressed by the information!</description>
      <pubDate>Tue, 16 Dec 2003 10:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145413#M801985</guid>
      <dc:creator>dude70_1</dc:creator>
      <dc:date>2003-12-16T10:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145414#M801986</link>
      <description>You may also find some shell compilers.&lt;BR /&gt;I haven't tried any of them.&lt;BR /&gt;&lt;BR /&gt;May be some feedback from some other "forumer" ?&lt;BR /&gt;&lt;BR /&gt;perl2exe :&lt;BR /&gt;&lt;A href="http://www.indigostar.com/perl2exe.htm" target="_blank"&gt;http://www.indigostar.com/perl2exe.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;shell compiler :&lt;BR /&gt;&lt;A href="http://www.comeaucomputing.com/faqs/ccshfaq.html" target="_blank"&gt;http://www.comeaucomputing.com/faqs/ccshfaq.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;shc :&lt;BR /&gt;&lt;A href="http://www.datsi.fi.upm.es/~frosal/" target="_blank"&gt;http://www.datsi.fi.upm.es/~frosal/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Tue, 16 Dec 2003 10:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145414#M801986</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-12-16T10:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145415#M801987</link>
      <description>Hi,&lt;BR /&gt; i tried shc. There is no performance improvement, it's a simple program that prevent the change to the file, by scrambling its content and adding the little code needed for the unscrambling, so it's slower.&lt;BR /&gt;&lt;BR /&gt;I do not know the others....&lt;BR /&gt;&lt;BR /&gt;   Massimo</description>
      <pubDate>Tue, 16 Dec 2003 10:44:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145415#M801987</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-12-16T10:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Performance of Shell Scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145416#M801988</link>
      <description>There have been previous discussions in other forums about shell compilers and the conclusion was that there were no true compilers, just wrappers that protected the code from being read or changed.</description>
      <pubDate>Tue, 16 Dec 2003 19:47:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/performance-of-shell-scripts/m-p/3145416#M801988</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-16T19:47:30Z</dc:date>
    </item>
  </channel>
</rss>

