The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Include PERL script with in the unix shell script ganapati UNIX for Dummies Questions & Answers 1 04-29-2008 09:18 AM
How to call a perl script from a shell script anumkoshy Shell Programming and Scripting 2 08-30-2007 01:23 AM
How to Run a shell script from Perl script in Parent shell? hifake Shell Programming and Scripting 16 08-28-2007 05:42 PM
Box A's perl script calling box B's shell script new2ss Shell Programming and Scripting 1 09-13-2006 03:17 AM
Looping a perl script in a shell script edkung Shell Programming and Scripting 8 10-04-2002 07:28 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2008
Registered User
 

Join Date: Mar 2008
Posts: 29
Diffrence b/w shell script and perl script

Hi,

Could anyone please tell me what are basic diffrence between a shell and a perl scipt i.e where to use shell scripting and where perl scripting? I want to know advantages of shell script over perl script and advantage of perl script over shell script.

Thanks,
Yogi
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-09-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,418
It is simple. Whatever you can do in shell, do in shell. If there is no way to do it in shell then use perl. If either of the two above is a major performance problem, then resort to C.

This sounds like homework - we do not support homework here.
Reply With Quote
  #3 (permalink)  
Old 06-10-2008
Registered User
 

Join Date: Jun 2008
Posts: 1
I only want to voice one minor bit of dissent to Jim's opinion. If your shell scripts are running slow, then go to Perl. If your "Perl Script" can't cope either go to Perl Monks to get help tuning it or hire a programmer.

Jim is accurate in stating that C is lightning fast, but Perl is about 20 times faster than most shell scripts and is usually adequate for most admin's.

Plus, if written correctly, you can take a Perl script and move it to different architectures and it will still work. Not true of the C program, you will have to retain your source code and recompile on the new system.
Reply With Quote
  #4 (permalink)  
Old 06-10-2008
Registered User
 

Join Date: Sep 2007
Location: Poland
Posts: 63
Quote:
Originally Posted by danieljdoughty View Post
Plus, if written correctly, you can take a Perl script and move it to different architectures and it will still work.
Remember that shell scripts are portable as well and sometime a simple shell script is faster than perl script (ex. '#!/bin/ksh^Mcp "$1" "/tmp/x/$2"').
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0