- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Performance of Shell Scripts
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 11:52 AM
12-15-2003 11:52 AM
I am not an expert in unix OS. Can anybody shed info about the performance of shell
(K-shell) scripts compared to java and c programs. That will be very helpful!
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 12:30 PM
12-15-2003 12:30 PM
SolutionIt 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.
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.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 03:20 PM
12-15-2003 03:20 PM
Re: Performance of Shell Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:53 PM
12-15-2003 06:53 PM
Re: Performance of Shell Scripts
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.
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.
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.
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 02:08 AM
12-16-2003 02:08 AM
Re: Performance of Shell Scripts
I'm impressed by the information!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 02:41 AM
12-16-2003 02:41 AM
Re: Performance of Shell Scripts
I haven't tried any of them.
May be some feedback from some other "forumer" ?
perl2exe :
http://www.indigostar.com/perl2exe.htm
shell compiler :
http://www.comeaucomputing.com/faqs/ccshfaq.html
shc :
http://www.datsi.fi.upm.es/~frosal/
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 02:44 AM
12-16-2003 02:44 AM
Re: Performance of Shell Scripts
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.
I do not know the others....
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 11:47 AM
12-16-2003 11:47 AM
Re: Performance of Shell Scripts
Bill Hassell, sysadmin